Created
June 20, 2017 12:35
-
-
Save nervouswiggles/732bbe9151d78372871592bf90acd1db 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
/* | |
ESP8266 Blink by Simon Peter | |
Blink the blue LED on the ESP-01 module | |
This example code is in the public domain | |
The blue LED on the ESP-01 module is connected to GPIO1 | |
(which is also the TXD pin; so we cannot use Serial.print() at the same time) | |
Note that this sketch uses LED_BUILTIN to find the pin with the internal LED | |
*/ | |
const int yellowLED = 12; | |
const int testLED = 13; | |
void setup() { | |
Serial.begin(230400); | |
pinMode(yellowLED,OUTPUT); | |
pinMode(testLED,OUTPUT); | |
} | |
// the loop function runs over and over again forever | |
void loop() { | |
blinkLED(); | |
} | |
void blinkLED(){ | |
digitalWrite(LED_BUILTIN, HIGH); // Turn the LED on (Note that LOW is the voltage level | |
digitalWrite(yellowLED,HIGH); // but actually the LED is on; this is because | |
digitalWrite(testLED,HIGH); | |
// it is acive low on the ESP-01) | |
delay(200); // Wait for a second | |
digitalWrite(LED_BUILTIN, LOW); // Turn the LED off by making the voltage HIGH | |
digitalWrite(yellowLED,LOW); // but actually the LED is on; this is because | |
digitalWrite(testLED,LOW); | |
delay(200); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment