Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int ledPin = 5;
- int buttonApin = 9;
- int buttonBpin = 8;
- byte leds = 0;
- void setup()
- {
- pinMode(ledPin, OUTPUT);
- pinMode(buttonApin, INPUT_PULLUP);
- pinMode(buttonBpin, INPUT_PULLUP);
- }
- void loop()
- {
- if (digitalRead(buttonApin) == LOW)
- {
- digitalWrite(ledPin, HIGH);
- }
- if (digitalRead(buttonBpin) == LOW)
- {
- digitalWrite(ledPin, LOW);
- }
- }
- here is the code i tried to add
- else (digitalRead(buttonApin) == HIGH)
- {
- digitalWrite(ledPin, LOW);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement