
SampleCode‐Blink
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 le
vel)
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
}
Note: 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 2and D2 !
SampleCode‐ScanWiFi
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. The follow sample code scans
the around WiFi:
/*
* This sketch demonstrates how to scan WiFi networks.
* The API is almost the same as with the WiFi Shield library,
* the most obvious difference being the different file you need to include:
*/
#include "ESP8266WiFi.h"