17 lines
321 B
C++
17 lines
321 B
C++
/* LDR test measuring with A0 in middle of 10k Ohm resistor and LDR
|
|
* +5V ---[ LDR ]---+---[ Resistor ]--- GND
|
|
|
|
|
Analog A0
|
|
*/
|
|
|
|
void setup() {
|
|
Serial.begin(9600);
|
|
}
|
|
|
|
void loop() {
|
|
int value = analogRead(A0); // Reads value between 0 and 1023
|
|
Serial.println(value);
|
|
delay(500);
|
|
}
|
|
|