Skip to content

Instantly share code, notes, and snippets.

@mactkg
Created November 15, 2011 10:59
Show Gist options
  • Save mactkg/1366785 to your computer and use it in GitHub Desktop.
Save mactkg/1366785 to your computer and use it in GitHub Desktop.
push
#define LED 13
#define BUTTON 7
int val;
void setup(){
pinMode(LED, OUTPUT);
pinMode(BUTTON, INPUT);
}
void loop(){
val = digitalRead(BUTTON);
if(val == HIGH){
digitalWrite(LED, HIGH);
}else{
digitalWrite(LED, LOW);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment