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:52] – [Grabbing project resources (on lab46)] 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 80: | Line 81: | ||
It may seem a bit bewildering or overwhelming at first, but like anything, time and exposure will ensure it becomes increasingly second nature. | It may seem a bit bewildering or overwhelming at first, but like anything, time and exposure will ensure it becomes increasingly second nature. | ||
- | =====Wiring up our circuit===== | + | ====Grabbing project resources (on lab46)==== |
- | Please reference the [[https:// | + | I have prepared a **grabit** |
- | =====Program===== | + | <cli> |
- | It is your task to implement a program (iwb2.c) that accepts input from the buttons, and outputs to the LEDbar, in accordance with the following: | + | lab46:~/ |
- | + | make: Entering directory '/ | |
- | * 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 the number being displayed by 1 (per update) | + | make: Leaving directory '/ |
- | + | lab46:~/ | |
- | * some things of note: | + | </ |
- | * each LED connected to a unique GPIO line | + | |
- | * each BUTTON connected to a unique GPIO line | + | |
- | * do NOT remove the delay. You may shorten (no shorter than 50mS) or lengthen the delay, but do not remove it entirely. | + | |
+ | At which point you can change into the newly created and populated **clr0/** directory. | ||
====Getting project resources from lab46 to your pi==== | ====Getting project resources from lab46 to your pi==== | ||
Line 105: | Line 104: | ||
Then, over on your pi, use **hg** to **pull** and **update** the new changes into place. Then you can proceed. | Then, over on your pi, use **hg** to **pull** and **update** the new changes into place. Then you can proceed. | ||
- | ====On your pi==== | + | =====Wiring up our circuit===== |
- | Study and run this program on your pi in conjunction with testing | + | Please reference the [[https:// |
+ | |||
+ | =====Program===== | ||
+ | It is your task to obtain, study, | ||
- | To utilize | + | * Retain |
+ | * 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 | ||
- | * **build-essential** (hopefully you took care of this in ntr0) | + | 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 |
- | * **wiringpi** (hopefully you took care of this in led0) | + | |
=====Compiling===== | =====Compiling===== |