Created
December 9, 2012 18:32
-
-
Save tagliati/4246395 to your computer and use it in GitHub Desktop.
Reading LDR value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to | |
int sensorValue = 0; // value read from the pot | |
void setup() { | |
// initialize serial communications at 9600 bps: | |
Serial.begin(9600); | |
} | |
void loop() { | |
sensorValue = analogRead(analogInPin); | |
Serial.print("sensor = " ); | |
Serial.print(sensorValue); | |
Serial.print("\t\n"); | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment