Created
March 9, 2021 04:37
-
-
Save dpnebert/22505487d97b7eb001acb6d649de1be7 to your computer and use it in GitHub Desktop.
Getting started with Arduino by flashing the built in LED.
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
#define BUILTIN_LED 13 | |
#define DELAY_TIME_IN_MILLISECONDS 1000 | |
void setup() { | |
pinMode(BUILTIN_LED, OUTPUT); | |
digitalWrite(BUILTIN_LED, LOW); | |
} | |
void loop() { | |
turnLedOn(); | |
delay(DELAY_TIME_IN_MILLISECONDS); | |
turnLedOff(); | |
delay(DELAY_TIME_IN_MILLISECONDS); | |
} | |
void turnLedOn() { | |
digitalWrite(BUILTIN_LED, HIGH); | |
} | |
void turnLedOff() { | |
digitalWrite(BUILTIN_LED, LOW); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment