Skip to content

Instantly share code, notes, and snippets.

@maxpromer
Created June 5, 2017 19:03
Show Gist options
  • Save maxpromer/7faacd985ae416f0d4a3f0ecaba5d77d to your computer and use it in GitHub Desktop.
Save maxpromer/7faacd985ae416f0d4a3f0ecaba5d77d to your computer and use it in GitHub Desktop.
#define LED1 LED_BUILTIN
#define LED2 23
unsigned long last1, last2;
void setup() {
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
}
void loop() {
if (millis() - last1 >= 500) {
last1 = millis();
digitalWrite(LED1, !digitalRead(LED1));
}
if (millis() - last2 >= 300) {
last2 = millis();
digitalWrite(LED2, !digitalRead(LED2));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment