#define LED 9
#define LED2 10
int val = 0;
void setup() {
pinMode(LED, OUTPUT);
pinMode(LED2, OUTPUT);
}
void loop() {
val = analogRead(0);
if (val>800){
digitalWrite(LED, HIGH);}
else{
digitalWrite(LED, LOW);}
if (val>800){
digitalWrite(LED2, HIGH);}
else{
digitalWrite(LED2, LOW);}
}
No comments:
Post a Comment