const int pb = 2;
const int LED1 = 13;
const int LED2 = 12;
int pushbutton = 0;
void setup() {
// put your setup code here, to run once:
pinMode(pb, INPUT);
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
}
void loop() {
// put your setup code here, to run repeatedly:
pushbutton = digitalRead(pb);
if (pushbutton == HIGH) {
digitalWrite(LED1, HIGH);
}
else {
digitalWrite(LED1, LOW);
}
if (pushbutton == LOW) {
digitalWrite(LED2, HIGH);
}
else {
digitalWrite(LED2, LOW);
}
}