This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:fall2020:common:projects:clr0 [2020/10/09 14:54] – [Getting project resources from lab46 to your pi] wedge | haas:fall2020:common:projects:clr0 [2020/10/09 19:49] (current) – [Input and Output via the GPIO pins on the pi] wedge | ||
---|---|---|---|
Line 18: | Line 18: | ||
ALSO: read through Chapter 5 in the [[https:// | ALSO: read through Chapter 5 in the [[https:// | ||
+ | AND: the wiringPi API on [[http:// | ||
=====Background===== | =====Background===== | ||
For this project, you will be working with a C program using the wiringPi library on the Raspberry Pi, wiring up a circuit containing an RGB LED to your breadboard and witnessing your ability to access and control it in varying states of on and off (more than just simply " | For this project, you will be working with a C program using the wiringPi library on the Raspberry Pi, wiring up a circuit containing an RGB LED to your breadboard and witnessing your ability to access and control it in varying states of on and off (more than just simply " | ||
Line 33: | Line 34: | ||
<cli> | <cli> | ||
- | yourpi: | + | yourpi: |
| | ||
| BCM | wPi | | | BCM | wPi | | ||
Line 93: | Line 94: | ||
At which point you can change into the newly created and populated **clr0/** directory. | At which point you can change into the newly created and populated **clr0/** directory. | ||
+ | |||
+ | ====Getting project resources from lab46 to your pi==== | ||
+ | Okay, you've snagged the project files on lab46. Now, how to get them to your pi? | ||
+ | |||
+ | The same way you've been juggling project files already, by using your mercurial repository! | ||
+ | |||
+ | Using the **hg** tool, be sure to **add**, **commit**, and **push** successfully on lab46. | ||
+ | |||
+ | Then, over on your pi, use **hg** to **pull** and **update** the new changes into place. Then you can proceed. | ||
=====Wiring up our circuit===== | =====Wiring up our circuit===== | ||
Line 98: | Line 108: | ||
=====Program===== | =====Program===== | ||
- | It is your task to implement | + | It is your task to obtain, study, and complete |
- | + | ||
- | * the LEDbar displays a 10-bit binary number (there exists code in previous projects that accomplishes this task | + | |
- | * ONE of the two buttons is an INCREMENT operation. By pressing it, your program needs to recognize it is pressed, and increment the number being displayed by 1 (per update) | + | |
- | * the OTHER of the two buttons is a DECREMENT operation. By pressing it, your program needs to recognize it is pressed, and decrement | + | |
- | + | ||
- | * some things of note: | + | |
- | * each LED connected to a unique GPIO line | + | |
- | * each BUTTON connected to a unique GPIO line | + | |
- | * do NOT remove | + | |
+ | * Retain the structure of the grabit code for your submission to be evaluated (do NOT use any added functions). | ||
+ | * Retain the variables of the grabit code, as named, in your submission to be evaluated. | ||
+ | * From the FreeNove tutorial or the wiringPi API on sofware PWM functionality, | ||
+ | * Update your clr0.c program to perform this action to complete it. | ||
+ | * do NOT remove the delay. You may shorten (no shorter than 500mS, please) or lengthen the delay, but do not remove it entirely. | ||
+ | NOTE: There may be functionally equivalent code in the resources for this project. You are not to copy and paste it, but instead to identify the needed functionality and translate it into a form compatible with the grabit program provided for this project. Failure to do so will not result in success. | ||
=====Compiling===== | =====Compiling===== |