Example Code for ESP8266-Blink

Last revision 2026/01/12

This article offers a step-by-step guide on using the ESP8266 with a FireBeetle Board to execute a simple LED blink project, ideal for beginners venturing into IoT development.

Hardware Preparation

Software Preparation

Other Preparation Work

Setup Arduino IDE Development Environment

  1. Plug FireBeetle to your computer, install the driver manually.

  2. Add FireBeetle Board URL to Arduino IDE: Open Arduino IDE, File->Preferences, find Additional Boards Manager URLs, copy the below link, and paste in the blank.

  3. Paste URL here.
    DFR0489-URL

  4. Click OK.

  5. Open Tools->Board->Boards Manager, waiting automatic update. You'll find FireBeetle-ESP8266.

    DFR0489_Board Manager

  6. Now, the development environment has been installed, you can use it like a normal Arduino board.

    DFR0489-FirBeetle_ESP8266

  7. After you have installed the FireBeetle ESP8266 development environment, it will comes with a lot of sample code in Arduino IDE, you can find them in File > Examples.

Sample Code

The default LED for FireBeetle Board-ESP8266 is D5 (IO2), input following code:

// GPIO 2 (D5) has a LED_BLINK attached to it. Give it a name:
int LED_BLINK = 2;
// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BLINK, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BLINK, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BLINK, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

Result

Cycle blink LED on GPIO2 pin with 1s interval.

ESP8266 has different pinmap in different development environment, For example: the LED connects IO2, which maps D5 in Arduino IDE It is totally different mean with 2 and D2 !

Was this article helpful?

TOP