Created
February 3, 2018 17:57
-
-
Save hyl392/df806c51ac2ae19a9ec0a7939ecb0cd3 to your computer and use it in GitHub Desktop.
Making the Drum Show Even More Flashy
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 buttonState = 0; | |
int led = 9; | |
int button = 7; | |
int led2 = 3; | |
void setup() { | |
pinMode(led, OUTPUT); | |
pinMode(button, INPUT); | |
pinMode(led2, OUTPUT); | |
// Serial.begin(9600); | |
} | |
void loop() { | |
buttonState = digitalRead(button); | |
// Serial.println(buttonState); | |
if (buttonState == HIGH){ | |
digitalWrite(led, LOW); | |
digitalWrite(led2, HIGH); | |
} else { | |
digitalWrite(led, HIGH); | |
digitalWrite(led2, LOW); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment