Skip to content

Instantly share code, notes, and snippets.

@Servuc
Created November 20, 2020 15:23
Show Gist options
  • Save Servuc/d1078368f5abf1c151c087b778dfbdaf to your computer and use it in GitHub Desktop.
Save Servuc/d1078368f5abf1c151c087b778dfbdaf to your computer and use it in GitHub Desktop.
#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