analog-in_digital-out_potentiometer_and_leds
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
analog-in_digital-out_potentiometer_and_leds [2016/11/07 22:11] – dwallace | analog-in_digital-out_potentiometer_and_leds [2016/11/09 13:37] (current) – dwallace | ||
---|---|---|---|
Line 5: | Line 5: | ||
HiTechnic' | HiTechnic' | ||
- | The files to accompany the HiTechnic Prototype Board (old version, not " | + | The files to accompany the HiTechnic Prototype Board (old version, not " |
- | [[File:HiTechnic_ExperimentersKitA.zip|HiTechnic_ExperimentersKitA.zip]] | + | {{HiTechnic_ExperimentersKitA.zip}} |
- | < | + | |
- | The PDF handbook included in the file above can also be downloaded here:< | + | |
- | [[File: | + | |
- | ==Wiring== | + | The PDF handbook included |
- | {|style=" | + | {{HiTechnicExperimentersKitHandbookA.pdf}} |
- | |- | + | |
- | !style=" | + | |
- | !style=" | + | |
- | |- | + | |
- | | 220 Ohm Resistor | + | |
- | | 6 | + | |
- | |- | + | |
- | | 10k Potentiometer | + | |
- | | 1 | + | |
- | |- | + | |
- | | LED | + | |
- | | 6 | + | |
- | |} | + | |
- | < | + | |
- | The six LEDs are connected to six pins that will act as a digital out. The potentiometer' | + | |
- | For example, when the pin A0 reads a voltage corresponding to 200 (~20%), the first LED will light up. At 400, 2 LEDS will light. At 1000 or greater, all LEDs will be lit. This digital-out pin control | + | |
- | <source lang=" | + | ===== Wiring ===== |
+ | |||
+ | |||
+ | * 220 Ohm Resistor (6) | ||
+ | |||
+ | * 10k Potentiometer (1) | ||
+ | |||
+ | * LED (6) | ||
+ | |||
+ | The six LEDs are connected to six pins that will act as a digital out. The potentiometer' | ||
+ | For example, when the pin A0 reads a voltage corresponding to 200 (~20%), the first LED will light up. At 400, 2 LEDS will light. At 1000 or greater, all LEDs will be lit. This digital-out pin control can be realized in the code excerpt below: | ||
+ | |||
+ | <code c> | ||
... | ... | ||
| | ||
Line 38: | Line 31: | ||
| | ||
... | ... | ||
- | </source> | + | </code> |
+ | |||
+ | {{PotLEDdiagram.jpg}}\\ | ||
+ | Circuit Diagram from HiTechnic' | ||
+ | |||
+ | {{PotCircuitPhoto.jpg}}\\ | ||
+ | Photo of completed circuit\\ | ||
+ | |||
+ | ===== Video ===== | ||
+ | |||
+ | {{youtube> | ||
- | < | + | **Note:** If the video doesn' |
- | {| style=" | + | ===== NXC Code ===== |
- | | | + | |
- | {| | + | |
- | | style=" | + | |
- | | style=" | + | |
- | | style=" | + | |
- | |- | + | |
- | | style=" | + | |
- | | | + | |
- | | style=" | + | |
- | |} | + | |
- | |} | + | |
- | ==Video== | + | |
- | < | + | |
- | <iframe width=" | + | |
- | </ | + | |
- | < | + | |
- | ''' | + | |
- | ==NXC Code== | + | <code c PotLED.c> |
- | <source lang="c" line start=" | + | |
/* | /* | ||
Filename: PotLED.nxc | Filename: PotLED.nxc | ||
Line 153: | Line 138: | ||
} | } | ||
} | } | ||
- | </source> | + | </code> |
+ | |||
+ | ===== Download ===== | ||
- | ===Download=== | + | {{PotLED.zip}} |
- | [[File:PotLED.zip]] | + |
analog-in_digital-out_potentiometer_and_leds.1478585467.txt.gz · Last modified: 2016/11/07 22:11 by dwallace