Untitled
unknown
plain_text
3 years ago
425 B
22
Indexable
#define button1 6 #define button2 7 #define led1 8 #define led2 9 void setup() { pinMode(button1,INPUT_PULLUP); pinMode(button2,INPUT_PULLUP); pinMode(led1,OUTPUT); pinMode(led2,OUTPUT); } void loop() { if(digitalRead(button1)==0) { digitalWrite(led1,HIGH);digitalWrite(led2,LOW); } else if(digitalRead(button2)==0) { digitalWrite(led1,LOW);digitalWrite(led2,HIGH); } delay(200); }