Skip to content

Instantly share code, notes, and snippets.

@nervouswiggles
Created June 20, 2017 12:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save nervouswiggles/732bbe9151d78372871592bf90acd1db to your computer and use it in GitHub Desktop.
Save nervouswiggles/732bbe9151d78372871592bf90acd1db to your computer and use it in GitHub Desktop.
/*
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