
ESP32-S3 board
The brain that runs your uploaded sketch — its Bluetooth radio is built in.
TinySkiff ESP32-S3 Lab · Day 28 of 30
Today your words start moving hardware. You wire a single LED, upload a sketch that listens over Bluetooth for two exact commands, and switch the light from across the room — write led_on and it lights, led_off and it goes dark. Yesterday's pipe now carries orders.
TSK-DAY28-BTLED
Hand this to an agent so it can pull the lesson packet and coach you step by step.
01 First, know the pieces
Six things, most of them old friends from your first circuits. Tap Define on any part you haven't met — the answer opens as a field note you can read and dismiss without losing your place.

The brain that runs your uploaded sketch — its Bluetooth radio is built in.

Spreads the pins into rows you can reach and label.

The light your phone will switch — it only works one way round.

Sits in series with the LED to keep the current gentle.

Two are enough today — the LED's feed and its return to ground.

Uploads the sketch and opens Serial Monitor.
02 Make the physical circuit
The official Freenove diagram is your chart — schematic on top, the same circuit built on a breadboard below. Click it to enlarge. The circuit is the one-LED layout you know from Blink; the command now arrives by radio.
Mind the LED's legs. The LED only lights one way round — long leg toward GPIO 2 through the 220 Ω resistor, short leg to ground. Unplug USB before you move any wire.
03 One action at a time
This is the main path — you can finish the day without opening a single field note. Tap each step as you go to keep your place.
Seat the ESP32-S3 on the GPIO extension board and keep USB unplugged while you wire.
Place the LED so its long leg (+) is on the GPIO 2 side and its short leg (−) heads toward ground.
Put the 220 Ω resistor in series between GPIO 2 and the LED's long leg.
Compare every wire to the chart, then plug in USB.
Open Sketch_20.2_BluetoothToLed.ino in Arduino IDE and upload it.
Open Serial Monitor at 115200 and look for the "device started" line.
On your phone, open LightBlue and connect to ESP32S3_Bluetooth, exactly as you did on Day 27.
Find the write characteristic, set the format to utf-string, and write led_on — underscore, exact spelling.
Watch the LED light, then write led_off to put it out.
04 Read just enough code
The BLE plumbing at the top of this sketch is Day 27's, line for line — same service, same name. Today's new idea lives in loop, where the board compares whatever arrived against two known commands and acts. Switch to MicroPython if you'd rather see the same idea in Python — the wiring never changes.
#define LED 2
void setup() {
pinMode(LED, OUTPUT);
setupBLE("ESP32S3_Bluetooth");
Serial.begin(115200);
Serial.println("\nThe device started, now you can pair it with Bluetooth!");
}
void loop() {
long now = millis();
if (now - lastMsg > 100) {
if (deviceConnected && strlen(rxload) > 0) {
if (strncmp(rxload, "led_on", 6) == 0) {
digitalWrite(LED, HIGH);
}
if (strncmp(rxload, "led_off", 7) == 0) {
digitalWrite(LED, LOW);
}
Serial.println(rxload);
memset(rxload,0,sizeof(rxload));
}
lastMsg = now;
}
}
setupBLE("ESP32S3_Bluetooth")The same radio setup as Day 27 — the board advertises under the same name, with the same service underneath. strncmp(rxload, "led_on", 6) == 0True when the first six characters the phone wrote spell led_on — underscore included. The buffer rxload holds whatever landed in the write characteristic. digitalWrite(LED, HIGH)The matched command drives GPIO 2 HIGH and the LED lights; led_off drives it LOW again. Serial.println(rxload)Echoes every received command to Serial Monitor, so you can watch the words arrive as the LED obeys. Optional side path · same circuit
led=Pin(2,Pin.OUT)
def on_rx(rx_data):
print("Received: ", rx_data)
if rx_data == b'led_on':
led.value(1)
elif rx_data == b'led_off':
led.value(0)
rx_data == b'led_on'Compares the received bytes to the exact command — every character must match, where the Arduino sketch checks only the front of the buffer.led.value(1)Drives GPIO 2 HIGH and the LED lights.Same pin, same wiring. Copy ble_advertising.py onto the board alongside this file. The Python version broadcasts as ESP32S3, so look for that name in LightBlue. Run it in Thonny if MicroPython is set up; otherwise skip it — it should never block the Arduino-first path.
05 Understand, don't memorise
Day 27 gave you a pipe between phone and board. Day 4 gave you digitalWrite. Put them together and you have remote control — and the pattern in today's loop is the skeleton of every protocol you'll ever meet.
LightBlue writes your text into the board's write characteristic.
The sketch copies the incoming bytes into rxload.
strncmp checks the buffer against led_on and led_off.
digitalWrite drives GPIO 2 HIGH or LOW and the LED follows.
phone text → match a known command → digitalWrite
The board compares raw characters. led_on with an underscore is a command; anything else is just text that scrolls past, and the LED holds its state.
BLE only carries the bytes. The meaning — which words count as commands and what they do — lives entirely in the sketch you wrote.
06 Know it worked
The proof is the LED obeying your phone — Serial Monitor backs it up by echoing each command as it lands.
Serial Monitor at 115200 shows "The device started, now you can pair it with Bluetooth!" on boot, then echoes every command the board receives.
07 Make the idea yours
Same working circuit, one new power: you decide what the commands are. It fits inside today's 25 minutes.
Add a third strncmp branch for led_blink that flashes the LED twice — HIGH, a short delay, LOW, and again. Upload and send your new word.
Change led_on and led_off to words of your own — keep the character counts in each strncmp honest — and drive the light with your own vocabulary.
Logbook
08 Learn it with a hand on the tiller
Every lesson ships with a code and a machine-readable packet, so an agent can guide you with full context.
TSK-DAY28-BTLED
How the agent should behave: guide one physical step at a time, wait for you to confirm, explain terms on request, and always check wiring, board, port, and USB before changing code.