Skip to content

Instantly share code, notes, and snippets.

@hyl392
Created February 3, 2018 17:57
Show Gist options
  • Save hyl392/df806c51ac2ae19a9ec0a7939ecb0cd3 to your computer and use it in GitHub Desktop.
Save hyl392/df806c51ac2ae19a9ec0a7939ecb0cd3 to your computer and use it in GitHub Desktop.
Making the Drum Show Even More Flashy
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