Skip to content

Instantly share code, notes, and snippets.

@austinbv
Created October 15, 2012 16:11
Show Gist options
  • Save austinbv/3893340 to your computer and use it in GitHub Desktop.
Save austinbv/3893340 to your computer and use it in GitHub Desktop.
int state = 0;
void setup() {
pinMode(buttonPin, INPUT);
pinMode(ledPin, OUTPUT);
}
void loop() {
state = digitalRead(buttonPin);
if(state == HIGH){
digitalWrite(ledPin, HIGH);
} else {
digitalWrite(ledPin, LOW);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment