ESP8266/Blink: Difference between revisions
Jump to navigation
Jump to search
(ESP-01 Blinker #777777) |
m (+code) |
||
| Line 2: | Line 2: | ||
[[File:ESP-01 Blink bb.png|800px]] | [[File:ESP-01 Blink bb.png|800px]] | ||
<pre> | |||
/* | |||
Blink | |||
Turns on an LED on for one second, then off for one second, repeatedly. | |||
Tweaked for ESP8266, connect LED to GPIO2 on ESP-## modules | |||
This example code is in the public domain. | |||
modified 8 May 2014 | |||
by Scott Fitzgerald | |||
modified 1 Nov 2015 | |||
by _ _ _ _ | |||
*/ | |||
void setup() { | |||
pinMode(2, OUTPUT); | |||
} | |||
// the loop function runs over and over again forever | |||
void loop() { | |||
digitalWrite(2, HIGH); // turn the LED on (HIGH is the voltage level) | |||
delay(1000); // wait for a second | |||
digitalWrite(2, LOW); // turn the LED off by making the voltage LOW | |||
delay(1000); // wait for a second | |||
} | |||
</pre> | |||
Latest revision as of 19:51, 1 November 2015
ESP-01 module configured with adjustable voltage regulator and LED connected to GPIO2.
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
Tweaked for ESP8266, connect LED to GPIO2 on ESP-## modules
This example code is in the public domain.
modified 8 May 2014
by Scott Fitzgerald
modified 1 Nov 2015
by _ _ _ _
*/
void setup() {
pinMode(2, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(2, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(2, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}