Last active
January 6, 2025 18:30
-
-
Save StuffAndyMakes/c381c324d631857e1b1ee371dee17518 to your computer and use it in GitHub Desktop.
millis() > delay() on Arduino
This file contains hidden or 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 <Arduino.h> | |
#define PIN_LED 13 | |
#define LED_STATE_SWITCH_INTERVAL 500 // milliseconds between LED state change | |
void setup(void) { | |
pinMode(PIN_LED, OUTPUT); | |
digitalWrite(PIN_LED, LOW); | |
} | |
void loop(void) { | |
digitalWrite(PIN_LED, HIGH); | |
delay(LED_STATE_SWITCH_INTERVAL); | |
digitalWrite(PIN_LED, LOW); | |
delay(LED_STATE_SWITCH_INTERVAL); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment