Skip to content

Instantly share code, notes, and snippets.

@skynettw
Created December 24, 2017 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skynettw/6fcb92d88e3976cd4554eea049a69fa8 to your computer and use it in GitHub Desktop.
Save skynettw/6fcb92d88e3976cd4554eea049a69fa8 to your computer and use it in GitHub Desktop.
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