Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#define PIN_INT 2
#define PIN_LED 13
void setup() {
// put your setup code here, to run once:
pinMode( PIN_LED, OUTPUT );
pinMode( PIN_INT, INPUT );
digitalWrite( PIN_LED, LOW );
}
void loop() {
delay(100);
digitalWrite( PIN_LED, digitalRead( PIN_INT ) ? HIGH : LOW );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment