Skip to main content
Torqheart
← Your first ESP32: from code on screen to a light on your desk

Level 1 of 4 · Build · 15 min

A blink in my own rhythm

Flash the Torqheart firmware onto your board once (or use the virtual board), then make the board's light blink in a rhythm you design.

🤖 Your robotUnnamed robotName your robot →

Before you play

An ESP32 is a small computer that costs a few hundred baht and sits inside robots, appliances and almost every IoT device. The code you write here is Arduino C++, the same language as in the Arduino IDE.

setup() runs once at power-up; loop() repeats forever. digitalWrite turns the light on or off; delay waits a number of milliseconds.

An ESP32 is optional. If you have one, flash the firmware once from Chrome or Edge on a computer, then press "Run on the real board": the light on your desk blinks to the same code as on screen.

You pass when the light changes at least 6 times in 6 seconds. The score goes up when your rhythm has several different lengths, like a heartbeat: ba-dum---

💡 Show a hint

Try a heartbeat: on 100, off 100, on 100, off 700, and see how many different lengths you get.

Scores are recomputed on the server with the same code as in your browser. Everyone plays the same simulated world.

Write with

Code reads fine · 4 operations

🔌 Real board (optional)

  1. 1 · Plug in an ESP32 and flash the Torqheart firmware (once)

    Works with ESP32 DevKit, ESP32-C3 SuperMini and ESP32-S3 DevKitC. The browser picks the right image for the chip.

  2. 2 · Connect, then send the code on screen to the board

Servo: brown → GND, red → 5V, orange → GPIO18 (ESP32) or GPIO4 (C3, S3) · servos draw a lot of current; if the board resets, give the servo its own 5 V supply

USBESP32LEDt = 0.00 s · LED 0/255

Adjust the settings and press Play. Results show here.

  • LED on/off changes ≥ 6 times
✍️ Build log (0)

Every run is kept in this browser, failures included. These are your brush strokes

Nothing yet. Press run for your first try

Leaderboard

Nobody has passed this level yet. Be the first.