This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:fall2021:common:projects:led0 [2021/08/27 20:54] – [Testing connectivity] wedge | haas:fall2021:common:projects:led0 [2021/08/27 21:00] (current) – wedge | ||
---|---|---|---|
Line 20: | Line 20: | ||
=====Background===== | =====Background===== | ||
For this project, you will be writing a C program using the wiringPi library on the Raspberry Pi, wiring up a red LED to your breadboard and witnessing your ability to control it via software. | For this project, you will be writing a C program using the wiringPi library on the Raspberry Pi, wiring up a red LED to your breadboard and witnessing your ability to control it via software. | ||
+ | |||
+ | =====Grabbing project resources (on lab46)===== | ||
+ | I have prepared a **grabit** for resources related to this project. To obtain: | ||
+ | |||
+ | <cli> | ||
+ | lab46: | ||
+ | make: Entering directory '/ | ||
+ | '/ | ||
+ | '/ | ||
+ | make: Leaving directory '/ | ||
+ | lab46: | ||
+ | </ | ||
+ | |||
+ | At which point you can change into the newly created and populated **led0** 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. | ||
+ | |||
+ | =====On your pi===== | ||
+ | Study and run this program on your pi in conjunction with testing and verifying operation of your properly hooked up electronics circuit. When done, submit it on lab46. | ||
+ | |||
+ | To utilize the needed functionality for this project, you will need to ensure you have the following packages installed: | ||
+ | |||
+ | * **build-essential** (hopefully you took care of this in ntr0) | ||
+ | * **wiringpi** | ||
+ | |||
+ | ====Installing wiringpi==== | ||
+ | An exception to the usual package installation process, especially for those with a Raspberry Pi model 4B: when you install **wiringpi** the usual way, we may end up with errors when proceeding further, such as the following: | ||
+ | |||
+ | <cli> | ||
+ | yourpi: | ||
+ | Oops - unable to determine board type... model: 17 | ||
+ | </ | ||
+ | |||
+ | What you will need to do is manually install an updated (and out of database) version of the **wiringpi** package, as follows (looking out for errors along the way): | ||
+ | |||
+ | <cli> | ||
+ | yourpi: | ||
+ | ... | ||
+ | yourpi: | ||
+ | ... | ||
+ | yourpi: | ||
+ | </ | ||
=====Input and Output via the GPIO pins on the pi===== | =====Input and Output via the GPIO pins on the pi===== | ||
Line 33: | Line 82: | ||
<cli> | <cli> | ||
- | yourpi: | + | yourpi: |
| | ||
| BCM | wPi | | | BCM | wPi | | ||
Line 60: | Line 109: | ||
| BCM | wPi | | | BCM | wPi | | ||
| | ||
- | yourpi: | + | yourpi: |
</ | </ | ||
Line 118: | Line 167: | ||
<WRAP info>The plastic rectangle should have a notch cut out from it, and notice that the ribbon cable connector has a notch included in it. That is a key to indicate how you need to connect the ribbon cable into the T-cobbler</ | <WRAP info>The plastic rectangle should have a notch cut out from it, and notice that the ribbon cable connector has a notch included in it. That is a key to indicate how you need to connect the ribbon cable into the T-cobbler</ | ||
+ | |||
====(1) red LED==== | ====(1) red LED==== | ||
You have a few LEDs included in your kit, some of notably different colours. Go for one of the distinctly red looking ones, resembling the following: | You have a few LEDs included in your kit, some of notably different colours. Go for one of the distinctly red looking ones, resembling the following: | ||
Line 198: | Line 248: | ||
In future projects you will start implementing more logic to attain further functionality. | In future projects you will start implementing more logic to attain further functionality. | ||
- | |||
- | ====Grabbing project resources (on lab46)==== | ||
- | I have prepared a **grabit** for resources related to this project. To obtain: | ||
- | |||
- | <cli> | ||
- | lab46: | ||
- | make: Entering directory '/ | ||
- | '/ | ||
- | '/ | ||
- | make: Leaving directory '/ | ||
- | lab46: | ||
- | </ | ||
- | |||
- | At which point you can change into the newly created and populated **led0** 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. | ||
- | |||
- | ====On your pi==== | ||
- | Study and run this program on your pi in conjunction with testing and verifying operation of your properly hooked up electronics circuit. When done, submit it on lab46. | ||
- | |||
- | To utilize the needed functionality for this project, you will need to ensure you have the following packages installed: | ||
- | |||
- | * **build-essential** (hopefully you took care of this in ntr0) | ||
- | * **wiringpi** | ||
- | |||
- | ===Installing wiringpi=== | ||
- | An exception to the usual package installation process, especially for those with a Raspberry Pi model 4B: when you install **wiringpi** the usual way, we may end up with errors when proceeding further, such as the following: | ||
- | |||
- | <cli> | ||
- | yourpi: | ||
- | Oops - unable to determine board type... model: 17 | ||
- | </ | ||
- | |||
- | What you will need to do is manually install an updated (and out of database) version of the **wiringpi** package, as follows (looking out for errors along the way): | ||
- | |||
- | <cli> | ||
- | yourpi: | ||
- | ... | ||
- | yourpi: | ||
- | ... | ||
- | yourpi: | ||
- | </ | ||
=====Compiling===== | =====Compiling===== | ||
Line 275: | Line 276: | ||
<cli> | <cli> | ||
- | lab46: | + | lab46:~/src/SEMESTER/ |
- | Submitting desig project " | + | |
- | -> led0.c(OK) | + | |
- | + | ||
- | SUCCESSFULLY SUBMITTED | + | |
</ | </ | ||