-
-
Save jscheel/25475e39cf9b522e12f4fd695b798a9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <dummy.h> | |
const int SWITCH_PIN = 0; | |
void setup() { | |
pinMode(LED_BUILTIN, OUTPUT); | |
pinMode(SWITCH_PIN, INPUT_PULLUP); | |
} | |
void loop() { | |
if (digitalRead(SWITCH_PIN) == LOW) { | |
blink(150, 100); | |
} | |
else { | |
digitalWrite(LED_BUILTIN, HIGH); | |
delay(100); | |
} | |
} | |
void blink(int onTime, int offTime) { | |
digitalWrite(LED_BUILTIN, LOW); | |
delay(onTime); | |
digitalWrite(LED_BUILTIN, HIGH); | |
delay(offTime); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment