This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:fall2020:common:projects:led1 [2020/09/03 17:08] – [Program] wedge | haas:fall2020:common:projects:led1 [2021/09/05 14:01] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 3: | Line 3: | ||
=====Objective===== | =====Objective===== | ||
- | To expand upon our previous efforts, through wiring up additional LEDs and generating a " | + | To expand upon our previous efforts, through wiring up additional LEDs and discovering what pattern |
We also further utilize time constraints, | We also further utilize time constraints, | ||
Line 81: | 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 first circuit===== | + | =====Wiring up our circuit===== |
- | Here we are, about to embark on our first foray into mixing with hardware and software. | + | This circuit is basically an expansion upon the one you made last week. So the parts needed remains the same, only expanding in the quantity of certain items as we expand the number of LEDs. |
- | In this project, we will be hooking up a peripheral to a couple | + | In this project, we will be hooking up a peripheral to some of our Raspberry Pi pins: light emitting |
You have likely encountered LEDs endlessly in your everyday life: commonly used as a "power light", | You have likely encountered LEDs endlessly in your everyday life: commonly used as a "power light", | ||
Line 106: | Line 106: | ||
{{ : | {{ : | ||
+ | |||
+ | Here's a good video overview of the functionality of a breadboard: | ||
+ | |||
+ | * https:// | ||
====(1) T-cobbler and data cable==== | ====(1) T-cobbler and data cable==== | ||
In your kit should be a T-shaped device (known as the " | In your kit should be a T-shaped device (known as the " | ||
Line 138: | Line 142: | ||
=====The Circuit to Construct===== | =====The Circuit to Construct===== | ||
- | With those components, you will want to place them onto your breadboard | + | With those components, you will want to place them onto your breadboard, expanding upon last week's circuit (picture of last week's circuit provided): |
{{ : | {{ : | ||
Line 144: | Line 148: | ||
Take note of how everything is being plugged in, and what connection on the T-cobbler is being utilized. | Take note of how everything is being plugged in, and what connection on the T-cobbler is being utilized. | ||
- | Notice how the circuit runs from ground | + | Notice how the circuit runs from ground to LED to resistor |
- | Before you seek to actually test your circuit, please get verification to proceed from the class channel on discord by posting a clear picture of everything. There are MANY moving parts, and especially as we have our first exposure, it is best to insert as many quality control checks as possible to ensure the greatest chances of mistakes are mitigated. | + | Please keep in mind: |
+ | * EACH LED needs to be interfaced with a unique GPIO pin | ||
+ | * EACH LED needs a corresponding resistor (no sharing!) Forgetting to use the resistor can lead to damage to the LED! | ||
+ | * ground connections can be shared (we call this " | ||
+ | * take note of which GPIO pin you are using, so can update the led1.c program | ||
+ | |||
+ | <WRAP info> | ||
+ | |||
+ | <WRAP info>It may be clarifying if you arranged your four LEDs in a row, from right to left, in order of your GPIO pins you've plugged into.</ | ||
====Testing connectivity==== | ====Testing connectivity==== | ||
To verify whether everything is hooked up correctly (including the correct positioning of the LED), please try the following: | To verify whether everything is hooked up correctly (including the correct positioning of the LED), please try the following: | ||
Line 165: | Line 177: | ||
<cli> | <cli> | ||
- | yourpi: | + | yourpi: |
</ | </ | ||
Line 181: | Line 193: | ||
<cli> | <cli> | ||
- | yourpi: | + | yourpi: |
- | yourpi: | + | yourpi: |
</ | </ | ||
Line 189: | Line 201: | ||
If you get no activity out of the LED, try reversing it and try again. | If you get no activity out of the LED, try reversing it and try again. | ||
+ | With an expanded set of LED circuits, be sure to test the operation of each one. | ||
=====Program===== | =====Program===== | ||
It is your task to compile, run, expand upon, and understand a program to interface with a set of LEDs (light emitting diodes), a nice software-hardware connection, on your raspberry pi. | It is your task to compile, run, expand upon, and understand a program to interface with a set of LEDs (light emitting diodes), a nice software-hardware connection, on your raspberry pi. | ||
Line 200: | Line 213: | ||
<cli> | <cli> | ||
- | lab46: | + | lab46: |
- | make: Entering directory '/ | + | make: Entering directory '/ |
- | '/ | + | '/ |
- | '/ | + | '/ |
- | make: Leaving directory '/ | + | make: Leaving directory '/ |
lab46: | lab46: | ||
</ | </ | ||
- | At which point you can change into the newly created and populated **led0** directory. | + | At which point you can change into the newly created and populated **led1** directory. |
====Getting project resources from lab46 to your pi==== | ====Getting project resources from lab46 to your pi==== | ||
Line 228: | Line 241: | ||
===Installing wiringpi=== | ===Installing wiringpi=== | ||
+ | <WRAP info> | ||
+ | |||
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: | 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> | <cli> | ||
- | yourpi: | + | yourpi: |
Oops - unable to determine board type... model: 17 | Oops - unable to determine board type... model: 17 | ||
</ | </ | ||
Line 238: | Line 253: | ||
<cli> | <cli> | ||
- | yourpi: | + | yourpi: |
... | ... | ||
- | yourpi: | + | yourpi: |
... | ... | ||
- | yourpi: | + | yourpi: |
</ | </ | ||
Line 272: | Line 287: | ||
<cli> | <cli> | ||
- | lab46: | + | lab46: |
- | Submitting desig project "led0": | + | Submitting desig project "led1": |
- | -> led0.c(OK) | + | -> led1.c(OK) |
SUCCESSFULLY SUBMITTED | SUCCESSFULLY SUBMITTED | ||
Line 284: | Line 299: | ||
< | < | ||
- | 26:led0:final tally of results (26/26) | + | 39:led1:final tally of results (39/39) |
- | *:led0:post picture of unpowered layout to #desig and get approval [6/6] | + | *:led1:post picture of unpowered layout to #desig and get approval [6/6] |
- | *:led0:post picture to #desig by Sunday before deadline [4/4] | + | *:led1:post picture to #desig by Sunday before deadline [6/6] |
- | *:led0:post picture of powered | + | *:led1:post picture of powered |
- | *:led0:grabit the code on lab46 by Sunday before deadline [4/4] | + | *:led1: |
- | *:led0:code is pushed to lab46 repository [6/6] | + | *: |
+ | *: | ||
+ | *:led1:updated | ||
</ | </ | ||
Line 297: | Line 314: | ||
* Solutions not utilizing indentation to promote scope and clarity will be subject to a 25% overall deduction | * Solutions not utilizing indentation to promote scope and clarity will be subject to a 25% overall deduction | ||
* Solutions not organized and easy to read are subject to a 25% overall deduction | * Solutions not organized and easy to read are subject to a 25% overall deduction | ||
+ |