Skip to content

Instantly share code, notes, and snippets.

@gallaugher
Created June 6, 2018 01:13
Show Gist options
  • Save gallaugher/167f7b42f7f4c81ca3dbe22911bfeb6a to your computer and use it in GitHub Desktop.
Save gallaugher/167f7b42f7f4c81ca3dbe22911bfeb6a to your computer and use it in GitHub Desktop.
Day 12, Learning By Doing 5 - BONUS while
byte BUTTON_PIN = 7;
byte LED_PIN = 6;
byte buttonState = 0;
void setup() {
// put your setup code here, to run once:
pinMode(BUTTON_PIN, INPUT);
pinMode(LED_PIN, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
while (digitalRead(BUTTON_PIN) == HIGH) {
digitalWrite(LED_PIN, HIGH);
}
digitalWrite(LED_PIN, LOW);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment