126e6a177261d740a5f691300e2e9f4b10b7f691
haas/fall2026/c4eng/projects/images/stl0_circuit.jpg
| ... | ... | Binary files /dev/null and b/haas/fall2026/c4eng/projects/images/stl0_circuit.jpg differ |
haas/fall2026/c4eng/projects/stl0.md
| ... | ... | @@ -0,0 +1,113 @@ |
| 1 | +# ENGR1050 C for Engineers |
|
| 2 | + |
|
| 3 | +# PROJECT: Seeing The Light (STL0) |
|
| 4 | + |
|
| 5 | +## OBJECTIVE |
|
| 6 | + |
|
| 7 | +We commence on our exploration of the electronics kit, by creating and |
|
| 8 | +controlling an LED with a C program on our pi. |
|
| 9 | + |
|
| 10 | +## OBTAIN THE PROJECT FILES |
|
| 11 | + |
|
| 12 | +To assist with consistency across all implementations, data files for use |
|
| 13 | +with this project are available on lab46 as a `grabit`, or within the |
|
| 14 | +class repository under the `projects/` directory. Please copy the data to |
|
| 15 | +your project directory in your private semester repository to begin work. |
|
| 16 | + |
|
| 17 | +Please study any provided code or supporting documents, and look up, |
|
| 18 | +experiment, and ask questions on aspects that you do not understand. |
|
| 19 | + |
|
| 20 | +## TASK |
|
| 21 | + |
|
| 22 | +Your task is to first study and understand what the provided code is |
|
| 23 | +doing. It is expected you will ask questions on discord to gain |
|
| 24 | +clarification. |
|
| 25 | + |
|
| 26 | +After exploring, assembling, and testing the intended circuit, wire up 2 |
|
| 27 | +LED circuits, connecting each to a unique GPIO pin on the pi, adapt the |
|
| 28 | +provided C code to blink both of the LEDs on the circuit, showing both in |
|
| 29 | +different states as they cycle on/off at least once every second. |
|
| 30 | + |
|
| 31 | + |
|
| 32 | + |
|
| 33 | +The circuits you will be constructing will be the same ones we previously |
|
| 34 | +built in class- an LED circuit receiving power (from a GPIO pin), having |
|
| 35 | +a 220 Ohm resistor, an LED, and then connecting to ground. |
|
| 36 | + |
|
| 37 | +While we connected our initial circuits directly to a constant 3.3v |
|
| 38 | +supply, here we will be connecting them to GPIO pins, allowing for |
|
| 39 | +conditional supply of power, based on our code. |
|
| 40 | + |
|
| 41 | +## OPERATING THE PROJECT |
|
| 42 | + |
|
| 43 | +These projects will have two paths to them, depending on which device you |
|
| 44 | +are using: |
|
| 45 | + |
|
| 46 | + * Raspberry Pi single board computer (4/5) using the `wiringPi` library |
|
| 47 | + * Raspberry Pi Pico microcontroller |
|
| 48 | + |
|
| 49 | +``` |
|
| 50 | +lab46:~/SEMESTER/c4eng/stl0$ make |
|
| 51 | +Please select which development environment: |
|
| 52 | + |
|
| 53 | + make wiringpi - using the Raspberr Pi with wiringpi library |
|
| 54 | + make pico - using the Raspberry Pi pico |
|
| 55 | + |
|
| 56 | +after which, you can use 'make' to build |
|
| 57 | +lab46:~/SEMESTER/c4eng/stl0$ |
|
| 58 | +``` |
|
| 59 | + |
|
| 60 | +Run the `make` command with the category representing the path you will |
|
| 61 | +be working with for this project. |
|
| 62 | + |
|
| 63 | +After which, if you do an `ls`, you will see a cyan-colored file called |
|
| 64 | +`stl0.c`. This is the C file you will be editing for this project. |
|
| 65 | + |
|
| 66 | +Go ahead and view it, study the code, eventually make any changes, save |
|
| 67 | +and return to the command-line. |
|
| 68 | + |
|
| 69 | +To build it, you simply run: `make` |
|
| 70 | + |
|
| 71 | +If there are no errors, it will build, and you proceed from there. |
|
| 72 | + |
|
| 73 | +## EXECUTION |
|
| 74 | + |
|
| 75 | +If on the pico, you will receive instructions on how to obtain your file. |
|
| 76 | + |
|
| 77 | +If on the full Raspberry Pi, you have a green executable you can run just |
|
| 78 | +as we've done in our other projects. |
|
| 79 | + |
|
| 80 | +## SUBMISSION |
|
| 81 | + |
|
| 82 | +To successfully complete this project, the following criteria must be |
|
| 83 | +met: |
|
| 84 | + |
|
| 85 | + * Code must compile/execute cleanly (no notes, warnings, nor errors) |
|
| 86 | + * Code must be nicely and consistently indented |
|
| 87 | + * Code must be well commented |
|
| 88 | + * Do NOT double space your code. Group like statements together. |
|
| 89 | + * Track/version the source code in your private semester repository |
|
| 90 | + |
|
| 91 | +To submit this project to me, make sure the `Makefile` and your completed |
|
| 92 | +`stl0.c` file are placed in your private semester repository under |
|
| 93 | +`c4eng/stl0/` |
|
| 94 | + |
|
| 95 | +What I'll be looking for: |
|
| 96 | + |
|
| 97 | +### RUBRIC |
|
| 98 | + |
|
| 99 | +I'll be evaluating the project based on the following criteria: |
|
| 100 | + |
|
| 101 | +``` |
|
| 102 | +130:stl0:final tally of results (130/130) |
|
| 103 | +*:stl0:post a picture or short video to the DISCORD [26/26] |
|
| 104 | +*:stl0:code compiles without errors [26/26] |
|
| 105 | +*:stl0:program conforms to project specifications [52/52] |
|
| 106 | +*:stl0:code tracked in private semester repo [26/26] |
|
| 107 | +``` |
|
| 108 | + |
|
| 109 | +Additionally: |
|
| 110 | + * Solutions not abiding by spirit of project will be subject to a 50% overall deduction |
|
| 111 | + * Solutions not utilizing descriptive why and how comments will be subject to a 25% overall deduction |
|
| 112 | + * Solutions not utilizing indentation to promote scope and clarity or otherwise maintaining consistency in code style and presentation will be subject to a 25% overall deduction |
|
| 113 | + * Solutions not organized and easy to read (assume a terminal at least 90 characters wide, 40 characters tall) are subject to a 25% overall deduction |