OLIMEX© 2017
ESP8266 with Arduino IDE
CHAPTER 4: UPLOADING BLINKING LED
CHAPTER 4: UPLOADING BLINKING LED
We need a properly configured hardware and software setup as described previously in chapters 2 and
3. Then we proceed as follows:
•
Start Arduino IDE.
•
Load the blinking LED example. Navigate to File → Examples → 01.Basics → Blink and click on it.
This is shown below:
•
A new window with code would open. Edit the code in order to reflect the hardware of ESP8266-
EVB boards. By default, the example assumes the LED is connected to digital pin #13 (like in most
Arduino boards). In our case the relay that has a LED is connected to digital pin #5. This
information can be acquired from the schematic of the board. Replace all occurrences of “13”
with “5”. The code should look as follows:
void setup() {
// initialize digital pin 5 as an output.
pinMode(5, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(5, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(5, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Page 11 of 15