Created
December 24, 2017 14:55
-
-
Save skynettw/6fcb92d88e3976cd4554eea049a69fa8 to your computer and use it in GitHub Desktop.
This file contains 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
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