This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
haas:fall2021:common:projects:iwb1 [2020/09/15 12:59] – external edit 127.0.0.1 | haas:fall2021:common:projects:iwb1 [2021/09/28 12:42] (current) – [Reading] wedge | ||
---|---|---|---|
Line 3: | Line 3: | ||
=====Objective===== | =====Objective===== | ||
- | In the ledX electronics projects, we played exclusively with output components, in the form of LEDs. Here, we continue our use of a button, further enhancing the functionality of the input in the overall process. | + | In the ledX electronics projects, we played exclusively with output components, in the form of LEDs. Here, we continue our use of the button, further enhancing the functionality of the input in the overall process: |
+ | * four LEDs (just like in led1) | ||
+ | * two buttons (one to increment the count, one to decrement the count) | ||
=====Abstraction===== | =====Abstraction===== | ||
- | {{page> | + | {{page> |
=====Locational Awareness===== | =====Locational Awareness===== | ||
- | {{page> | + | {{page> |
=====Reading===== | =====Reading===== | ||
Line 16: | Line 18: | ||
* [[https:// | * [[https:// | ||
+ | Also, some background information on buttons: | ||
+ | |||
+ | * https:// | ||
=====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 multiple LEDs and a button to your breadboard and witnessing your ability to access and control them via software. | For this project, you will be working with a C program using the wiringPi library on the Raspberry Pi, wiring up a circuit containing multiple LEDs and a button to your breadboard and witnessing your ability to access and control them via software. | ||
Line 31: | Line 36: | ||
<cli> | <cli> | ||
- | yourpi: | + | yourpi: |
| | ||
| BCM | wPi | | | BCM | wPi | | ||
Line 81: | Line 86: | ||
This circuit is basically an enhancement upon the one you made for the led1 project. So the parts needed has some similar items, but also some new ones. | This circuit is basically an enhancement upon the one you made for the led1 project. So the parts needed has some similar items, but also some new ones. | ||
- | In this project, we will be hooking up two different peripherals to some of our Raspberry Pi pins: a set of light emitting diodes (LED) and a button, and then proceed to interface with them to access and control their state (of being ON or OFF). | + | In this project, we will be hooking up two different peripherals to some of our Raspberry Pi pins: a set of light emitting diodes (LED) and buttons, and then proceed to interface with them to access and control their state (each one in some combination |
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 89: | Line 94: | ||
For this endeavour, you will need to obtain the following items out of the electronics kit you obtained for the class: | For this endeavour, you will need to obtain the following items out of the electronics kit you obtained for the class: | ||
- | {{ :haas:fall2020: | + | {{ :haas:fall2021: |
=====The Circuit to Construct===== | =====The Circuit to Construct===== | ||
Line 109: | Line 114: | ||
=====Program===== | =====Program===== | ||
- | It is your task to compile, run, and understand a program to interface with the LEDs (light emitting diodes) and button. The button provides | + | It is your task to compile, run, and understand a program to interface with the LEDs (light emitting diodes) and button. The buttons provide |
- | The provided | + | The provided |
- | * expand the program to support FOUR LEDs | + | * implement a program |
+ | * if one button is pressed, increment the count from the current value to 15, rolling over to 0 as needed | ||
+ | * if the other button is pressed, decrement the count from the current value to 0, rolling over to 15 as needed | ||
+ | * have a 50mS - 500mS delay between state changes | ||
+ | * pressing the button enables the change for that next state (after the current delay expires) | ||
+ | * implement | ||
* each LED connected to a unique GPIO line | * each LED connected to a unique GPIO line | ||
- | * adapt the program to " | + | |
- | * NOTE: you may discover there to be " | + | |
- | * do NOT remove the delay. You may shorten (no shorter than 50mS) or lengthen the delay, but do not remove it entirely. | + | |
====Grabbing project resources (on lab46)==== | ====Grabbing project resources (on lab46)==== | ||
I have prepared a **grabit** for resources related to this project. To obtain: | I have prepared a **grabit** for resources related to this project. To obtain: | ||
<cli> | <cli> | ||
- | lab46: | + | lab46: |
- | make: Entering directory '/ | + | make: Entering directory '/ |
- | '/ | + | '/ |
- | '/ | + | '/ |
- | make: Leaving directory '/ | + | make: Leaving directory '/ |
- | lab46: | + | lab46: |
</ | </ | ||
Line 176: | Line 186: | ||
<cli> | <cli> | ||
- | lab46: | + | lab46: |
- | Submitting desig project " | + | |
- | -> iwb1.c(OK) | + | |
- | + | ||
- | SUCCESSFULLY SUBMITTED | + | |
</ | </ | ||
Line 191: | Line 197: | ||
*:iwb1:post picture of unpowered layout to #desig and get approval [8/8] | *:iwb1:post picture of unpowered layout to #desig and get approval [8/8] | ||
*:iwb1:post picture to #desig by Sunday before deadline [4/4] | *:iwb1:post picture to #desig by Sunday before deadline [4/4] | ||
- | *:iwb1:post picture of powered LEDs in layout to #desig [8/8] | + | *:iwb1:post picture of button-enabled LED count in layout to #desig [8/8] |
*: | *: | ||
*: | *: |