Skip to content

Instantly share code, notes, and snippets.

@JeffersGlass
Created July 12, 2020 22:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeffersGlass/079c1e65c036b832eddc9ede633fadf6 to your computer and use it in GitHub Desktop.
Save JeffersGlass/079c1e65c036b832eddc9ede633fadf6 to your computer and use it in GitHub Desktop.
const int LED = 2;
const int button = 5;
void setup() {
pinMode(button, INPUT_PULLUP);
pinMode(LED, OUTPUT);
}
void loop() {
int reading = digitalRead(button);
if (reading == HIGH){
digitalWrite(LED, LOW);
}
else {
digitalWrite(LED, HIGH);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment