Skip to content

Instantly share code, notes, and snippets.

@nulltask
Created October 22, 2011 20:57
Show Gist options
  • Save nulltask/1306485 to your computer and use it in GitHub Desktop.
Save nulltask/1306485 to your computer and use it in GitHub Desktop.
p036
#define LED 13
#define BUTTON 7
int val = 0;
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