Built-in project · ESP-01S

ESP-01 blink

An LED wired from 3V3 through a resistor to GPIO 2 lights together with the module’s own blue one, whenever the pin goes low. The whole build, an ESP-01S and 2 more parts, runs here in your browser on the firmware below; open it in the editor to change the wiring or the code and run it again.

Runs in your browser. Free, and no account needed.

ESP-01 blink · ESP-01Slive0.000 s 0.00x
Click to open it in the editor
The circuit itself, running here on the simulator. Press what can be pressed; click anything else to open it in the editor.

The code

The firmware exactly as the editor opens it. Change a line there and press Run: it compiles in the browser.

sketch.ino · ESP-01S
// Blink: the module's own LED on D4, and an LED you wire yourself on D1.
//
// The LED on an ESP-12 module is GPIO2, which the NodeMCU silkscreen calls D4,
// and it is active low: LOW lights it. The wired one on D1 is the ordinary way
// round, so the two are always opposite.

const int kLed = LED_BUILTIN; // GPIO2, D4, active low
const int kWired = D1;        // GPIO5, an LED and a resistor to ground

void setup()
{
    pinMode(kLed, OUTPUT);
    pinMode(kWired, OUTPUT);
}

void loop()
{
    digitalWrite(kLed, LOW); // lit
    digitalWrite(kWired, HIGH);
    delay(500);
    digitalWrite(kLed, HIGH); // dark
    digitalWrite(kWired, LOW);
    delay(500);
}

Parts list

4 parts, plus the jumper wires. Every one is in the editor's parts bin.

How it is wired

3 connections, pin by pin, read from the circuit itself. Each line is one set of pins joined together, by a jumper wire or a breadboard strip.

  • ESP-01S pin GPIO2; Resistor, 220 Ω pin 2
  • ESP-01S pin 3V3; LED, blue pin A
  • LED, blue pin C; Resistor, 220 Ω pin 1

Change it and keep it

Open it in the editor, change the circuit or the code, and keep your version in a free account.