User Tools

Site Tools


haas:fall2020:common:projects:led1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
haas:fall2020:common:projects:led1 [2020/09/03 13:08] – [Grabbing project resources (on lab46)] wedgehaas:fall2020:common:projects:led1 [2021/09/05 10: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 "binary counting" pattern of lit LEDs on your pi.+To expand upon our previous efforts, through wiring up additional LEDs and discovering what pattern they activate in, given the provided program.
  
 We also further utilize time constraints, tying project credit to your starting on the project before the deadline (so be sure to plan accordingly!) We also further utilize time constraints, tying project credit to your starting on the project before the deadline (so be sure to plan accordingly!)
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 areabout 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 sameonly 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 of our Raspberry Pi pins: light emitting diode (LED) and supporting hardware, and then proceed to interface with it to control its state (of being ON or OFF).+In this project, we will be hooking up a peripheral to some of our Raspberry Pi pins: light emitting diodes (LED) and supporting hardware, and then proceed to interface with them to control its state (of being ON or OFF).
  
 You have likely encountered LEDs endlessly in your everyday life: commonly used as a "power light", which when lit, indicates the device is powered on, among many, MANY, **MANY** other applications. You have likely encountered LEDs endlessly in your everyday life: commonly used as a "power light", which when lit, indicates the device is powered on, among many, MANY, **MANY** other applications.
Line 106: Line 106:
  
 {{ :haas:fall2020:common:projects:breadboardlogic.png?400 |}} {{ :haas:fall2020:common:projects:breadboardlogic.png?400 |}}
 +
 +Here's a good video overview of the functionality of a breadboard:
 +
 +  * https://www.youtube.com/watch?v=6WReFkfrUIk
 ====(1) T-cobbler and data cable==== ====(1) T-cobbler and data cable====
 In your kit should be a T-shaped device (known as the "T-cobbler" with some aspect of pin names silkscreened on it, and a 40-pin ribbon cable). Colors may vary, but essentially it looks like this: In your kit should be a T-shaped device (known as the "T-cobbler" with some aspect of pin names silkscreened on it, and a 40-pin ribbon cable). Colors may vary, but essentially it looks like this:
Line 138: Line 142:
  
 =====The Circuit to Construct===== =====The Circuit to Construct=====
-With those components, you will want to place them onto your breadboard in a manner similar to this:+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):
  
 {{ :haas:fall2020:common:projects:led_circuit.png?400 |}} {{ :haas:fall2020:common:projects:led_circuit.png?400 |}}
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 to resistor to LED to pin "GPIO17/Physical pin 11/Wiring Pi pin 0"+Notice how the circuit runs from ground to LED to resistor to pin "GPIO17/Physical pin 11/Wiring Pi pin 0"
  
-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 "common ground")
 +  * take note of which GPIO pin you are using, so can update the led1.c program
 +
 +<WRAP info>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.</WRAP>
 +
 +<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.</WRAP>
 ====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:~/src/desig/led0$ gpio mode 0 OUT+yourpi:~/src/desig/led1$ gpio mode 0 OUT
 </cli> </cli>
  
Line 181: Line 193:
  
 <cli> <cli>
-yourpi:~/src/desig/led0$ gpio write 0 1      ## activate voltage on wiringpi pin 0 (turn on) +yourpi:~/src/desig/led1$ gpio write 0 1      ## activate voltage on wiringpi pin 0 (turn on) 
-yourpi:~/src/desig/led0$ gpio write 0 0      ## deactivate voltage on wiringpi pin 0 (turn off)+yourpi:~/src/desig/led1$ gpio write 0 0      ## deactivate voltage on wiringpi pin 0 (turn off)
 </cli> </cli>
  
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 228: Line 241:
  
 ===Installing wiringpi=== ===Installing wiringpi===
 +<WRAP info>NOTE: you should have already installed wiringpi in order to do the led0 project; you do not need to do it again</WRAP>
 +
 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:~/src/desig/led0$ gpio readall+yourpi:~/src/desig/led1$ gpio readall
 Oops - unable to determine board type... model: 17 Oops - unable to determine board type... model: 17
 </cli> </cli>
Line 238: Line 253:
  
 <cli> <cli>
-yourpi:~/src/desig/led0$ wget https://project-downloads.drogon.net/wiringpi-latest.deb+yourpi:~/src/desig/led1$ wget https://project-downloads.drogon.net/wiringpi-latest.deb
 ... ...
-yourpi:~/src/desig/led0$ sudo dpkg -i wiringpi-latest.deb+yourpi:~/src/desig/led1$ sudo dpkg -i wiringpi-latest.deb
 ... ...
-yourpi:~/src/desig/led0$ rm -f wiringpi-latest.deb+yourpi:~/src/desig/led1$ rm -f wiringpi-latest.deb
 </cli> </cli>
  
Line 272: Line 287:
  
 <cli> <cli>
-lab46:~/src/desig/led0$ submit desig led0 led0.c +lab46:~/src/desig/led1$ submit desig led1 led1.c 
-Submitting desig project "led0": +Submitting desig project "led1": 
-    -> led0.c(OK)+    -> led1.c(OK)
  
 SUCCESSFULLY SUBMITTED SUCCESSFULLY SUBMITTED
Line 284: Line 299:
  
 <code> <code>
-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 LED to #desig [6/6]  +*:led1:post picture of powered LEDs in layout to #desig [6/6]  
-*:led0:grabit the code on lab46 by Sunday before deadline [4/4+*:led1:grabit on the code on lab46 by Sunday before deadline [3/3] 
-*:led0:code is pushed to lab46 repository [6/6]+*:led1:led1.c code adequately expanded per project requirements [6/6] 
 +*:led1:led1.c comments describing what is happening [6/6
 +*:led1:updated code is pushed to lab46 repository [6/6]
 </code> </code>
  
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
 +
haas/fall2020/common/projects/led1.1599152930.txt.gz · Last modified: 2020/09/03 13:08 by wedge