Built-in project · Arduino Nano ESP32

Nano ESP32 blink

The Nano ESP32’s orange LED on D13 and its RGB LED, whose red, green and blue light in turn when their pins go LOW. The whole build, an Arduino Nano ESP32, 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.

Teaching? Assign it to your class in one click.

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

The parts retail for about $26. On Mokxi they're free.

Nano ESP32 blink · Arduino Nano ESP32live0.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 · Arduino Nano ESP32
// Blink: the orange LED on D13, then the RGB LED's three colors in turn.
//
// LED_BUILTIN is the orange LED on D13, which lights when the pin is HIGH.
// The RGB LED is common anode: each color lights when its pin is LOW, so
// HIGH turns it off.
//
// Mokxi builds this board with Tools, Pin Numbering, "By GPIO number
// (legacy)": D13 is GPIO 48. Write D13, not 13, and the sketch means the
// same pin under either setting.

const int COLORS[] = {LED_RED, LED_GREEN, LED_BLUE};

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  for (int pin : COLORS) {
    pinMode(pin, OUTPUT);
    digitalWrite(pin, HIGH);  // off
  }
}

void loop() {
  for (int pin : COLORS) {
    digitalWrite(LED_BUILTIN, HIGH);
    digitalWrite(pin, LOW);   // this color on
    delay(400);
    digitalWrite(LED_BUILTIN, LOW);
    digitalWrite(pin, HIGH);  // and off
    delay(400);
  }
}

Parts list

2 parts, plus the jumper wires. They retail for about $26; on Mokxi they're free.

Change it and keep it

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