arduino:arduino_crash_course:analog_input
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
arduino:arduino_crash_course:analog_input [2012/11/12 18:43] – [Analog Input] mithat | arduino:arduino_crash_course:analog_input [2017/12/06 01:16] – [Analog Input] mithat | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Analog Input ====== | ====== Analog Input ====== | ||
- | As we have seen, an Arduino digital input is one that have one of two states: HIGH or LOW. Most Arduino implementations also permit you to connect an input whose value can be any value between 0 volts and (by default) the power-supply voltage and then convert the input level to an integer value between 0 an 1204. The Arduino literature refers to these as " | + | As we have seen, an Arduino digital input is one that have one of two states: HIGH or LOW. Most Arduino implementations also permit you to connect an input whose value can be any value between 0 volts and (by default) the power-supply voltage, and then convert the input level to an integer value between 0 an 1023. The Arduino literature refers to these as " |
- | Consult the documentation for your specific Arduino board to detmine | + | Consult the documentation for your specific Arduino board to determine |
===== Night light ===== | ===== Night light ===== | ||
Line 14: | Line 14: | ||
There are more reliable and calibrated light-level sensors available that may be a better (but significanly more expensive!) choice if you wish not to deal with the tweakiness of Cds cells. | There are more reliable and calibrated light-level sensors available that may be a better (but significanly more expensive!) choice if you wish not to deal with the tweakiness of Cds cells. | ||
</ | </ | ||
+ | |||
+ | FIXME We need a circuit diagram | ||
<file c NightLight.ino> | <file c NightLight.ino> | ||
Line 32: | Line 34: | ||
void loop() { | void loop() { | ||
- | lightLevel = analogRead(inputPin); | + | lightLevel = analogRead(inputPin); |
if (lightLevel <= lightThreshold) | if (lightLevel <= lightThreshold) |
arduino/arduino_crash_course/analog_input.txt · Last modified: 2017/12/06 01:27 by mithat