ELECROW EasyESP-1: Rapid Prototyping WiFi ESP8266 Experimenter Board
The ELECROW EasyESP-1 is a rapid prototyping WiFi ESP8266 experimenter board designed for easy programming and GPIO access. This board is perfect for IoT projects, prototyping, and development, offering a breadboard-friendly design for quick connections.
ESP8266 WiFi module with 802.11 b/g/n protocol
Onboard USB-to-UART converter for easy programming
Breadboard-friendly design for easy connections
GPIO access to all ESP8266 pins
Power supply options: USB, battery, or external power source
Support for Arduino IDE, MicroPython, and Lua programming languages
The ELECROW EasyESP-1 has the following pinout:
| Pin | Function |
| --- | --- |
| 1 | VCC (3.3V) |
| 2 | GND |
| 3 | RX (UART) |
| 4 | TX (UART) |
| 5 | GPIO0 |
| 6 | GPIO2 |
| 7 | GPIO4 |
| 8 | GPIO5 |
| 9 | GPIO12 |
| 10 | GPIO13 |
| 11 | GPIO14 |
| 12 | GPIO15 |
| 13 | GPIO16 |
| 14 | GPIO17 |
| 15 | GPIO18 |
The ELECROW EasyESP-1 can be programmed using various programming languages, including Arduino IDE, MicroPython, and Lua. Here are some example codes to get you started:
### Example 1: WiFi Connection using Arduino IDE
This example demonstrates how to connect to a WiFi network using the Arduino IDE.
```c
#include <WiFi.h>
const char ssid = "your_wifi_ssid";
const char password = "your_wifi_password";
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
// Put your code here
}
```
### Example 2: Blinking LED using MicroPython
This example demonstrates how to blink an LED connected to GPIO12 using MicroPython.
```python
import machine
import utime
led = machine.Pin(12, machine.Pin.OUT)
while True:
led.value(1)
utime.sleep(0.5)
led.value(0)
utime.sleep(0.5)
```
### Example 3: HTTP Server using Lua
This example demonstrates how to create a simple HTTP server using Lua to control a relay connected to GPIO13.
```lua
-- Include the WiFi and HTTP libraries
wifi.setmode(wifi.STATION)
wifi.sta.config("your_wifi_ssid","your_wifi_password")
wifi.sta.connect()
-- Create an HTTP server
srv = net.createServer(net.TCP)
-- Define the relay pin
gpio.mode(13, gpio.OUTPUT)
-- Define the HTTP handler
srv:listen(80,function(conn)
conn:on("receive",function(conn,payload)
if payload:find("GET /on") then
gpio.write(13, gpio.HIGH)
conn:send("HTTP/1.1 200 OK
Relay is ON")
elseif payload:find("GET /off") then
gpio.write(13, gpio.LOW)
conn:send("HTTP/1.1 200 OK
Relay is OFF")
else
conn:send("HTTP/1.1 404 Not Found
")
end
end)
conn:on("sent",function(conn) conn:close() end)
end)
```
These examples demonstrate the ease of use and flexibility of the ELECROW EasyESP-1 for various IoT projects.