nxt_sensor-in_digital-out_microphone_and_leds
Differences
This shows you the differences between two versions of the page.
nxt_sensor-in_digital-out_microphone_and_leds [2016/11/01 15:43] – created dwallace | nxt_sensor-in_digital-out_microphone_and_leds [2016/11/09 13:43] (current) – dwallace | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== NXT Sensor-In/ | ====== NXT Sensor-In/ | ||
- | ==Wiring== | + | ==== Wiring |
- | ''' | + | **NOTE:** This is the same setup as the last exercise " |
Plug the NXT sound sensor (microphone) into sensor port 2 0n the NXT. | Plug the NXT sound sensor (microphone) into sensor port 2 0n the NXT. | ||
- | {|style=" | + | * 220 Ohm Resistor |
- | |- | + | |
- | !style=" | + | |
- | !style=" | + | |
- | |- | + | |
- | | 220 Ohm Resistor | + | |
- | | 6 | + | |
- | |- | + | |
- | | 10k Potentiometer | + | |
- | | 1 | + | |
- | |- | + | |
- | | LED | + | |
- | | 6 | + | |
- | |} | + | |
- | <br> | + | |
The six LEDs are connected to six digital-out pins. As the volume varies between 0% and 100% of the sensor' | The six LEDs are connected to six digital-out pins. As the volume varies between 0% and 100% of the sensor' | ||
- | This digital-out pin control can be realized in the code excerpt below:< | + | This digital-out pin control can be realized in the code excerpt below: |
- | <source lang="c" line start=" | + | <code c> |
... | ... | ||
| | ||
Line 32: | Line 23: | ||
| | ||
... | ... | ||
- | </source> | + | </code> |
+ | |||
+ | {{PotLEDdiagram.jpg}}\\ | ||
+ | Circuit Diagram from HiTechnic' | ||
+ | |||
+ | {{PotCircuitPhoto.jpg}}\\ | ||
+ | Photo of completed circuit\\ | ||
+ | |||
+ | ===== Video ===== | ||
- | < | ||
- | {| style=" | + | **Note:** If the video doesn't work just reload the page. |
- | | | + | |
- | {| | + | |
- | | style=" | + | |
- | | style=" | + | |
- | | style=" | + | |
- | |- | + | |
- | | style=" | + | |
- | | | + | |
- | | style=" | + | |
- | |} | + | |
- | |} | + | |
- | ==Video== | + | ===== NXC Code ===== |
- | < | + | |
- | <iframe width=" | + | |
- | </ | + | |
- | < | + | |
- | ==NXC Code== | + | <code c MicLED.nxc> |
- | <source lang="c" line start=" | + | |
/* | /* | ||
Filename: MicLED.nxc | Filename: MicLED.nxc | ||
Line 161: | Line 144: | ||
StopAllTasks(); | StopAllTasks(); | ||
} | } | ||
- | </source> | + | </code> |
+ | |||
+ | ===== Download ===== | ||
- | ===Download=== | + | {{MicLED.zip}} |
- | [[File:MicLED.zip]] | + |
nxt_sensor-in_digital-out_microphone_and_leds.txt · Last modified: 2016/11/09 13:43 by dwallace