Created
March 13, 2020 08:51
-
-
Save osde8info/3c500d7b2d7f6e8d37709978c70248e5 to your computer and use it in GitHub Desktop.
arduino ascii blink
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
/* | |
asciiblink | |
Turns LED_BUILTIN on and off repeatedly. | |
LED_BUILTIN is defined as the correct LED pin independent of which board is used. | |
If you want to know what pin the on-board LED is connected to on your Arduino | |
model, check the Technical Specs of your board at: | |
https://www.arduino.cc/en/Main/Products | |
BASED ON | |
http://www.arduino.cc/en/Tutorial/ASCIITable | |
& | |
http://www.arduino.cc/en/Tutorial/Blink | |
*/ | |
// the setup function runs once when you press reset or power the board | |
void setup() { | |
Serial.begin(9600); | |
// initialize digital pin LED_BUILTIN as an output. | |
pinMode(LED_BUILTIN, OUTPUT); | |
} | |
// the loop function runs over and over again forever | |
void loop() { | |
Serial.println("HIGH"); | |
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) | |
delay(400); // wait for a second | |
Serial.println("LOW"); | |
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW | |
delay(100); // wait for a second | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment