Instantly share code, notes, and snippets.

Embed
What would you like to do?
int LEDpin = 13;
void setup() {
Serial.begin(9600);
pinMode(LEDpin, OUTPUT);
digitalWrite(LEDpin, LOW);
}
void loop() {
int pr = analogRead(A2);
Serial.println(pr);
if (pr < 10) {
digitalWrite(LEDpin, HIGH);
} else {
digitalWrite(LEDpin, LOW);
}
delay(500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment