
ESP32-S3 board
The brain that runs your uploaded sketch.
TinySkiff ESP32-S3 Lab · Day 4 of 30
Today the board starts listening. You wire a push button to one pin and a LED to another, then upload a sketch that watches the button and lights the LED whenever it's pressed — the smallest complete loop of sense, decide, and act.
TSK-DAY04-BUTTON
Hand this to an agent so it can pull the lesson packet and coach you step by step.
01 First, know the pieces
Eight things, most of them tiny. 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.

Spreads the pins into rows you can reach and label.

The light you'll switch — it only works one way round.

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

Hold the button's pin at a steady level until you press.

A four-pin switch that closes the circuit when pressed.

Temporary, solder-free connections.

Uploads the sketch to the board.
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. Each connection tells you where the wire goes and why.
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.
Wire the push button so one side reaches GPIO 13 and the other reaches ground.
Add the 10 kΩ resistor that holds GPIO 13 steady until the button is pressed.
Compare every wire to the chart before you plug in USB.
Open Sketch_02.1_ButtonAndLed.ino in Arduino IDE and upload it.
Press the button and watch the LED.
04 Read just enough code
The whole sketch is short. Two lines set the pins up; the loop just asks the button and answers with the LED. Switch to MicroPython if you'd rather see the same idea in Python — the wiring never changes.
#define PIN_LED 2
#define PIN_BUTTON 13
void setup() {
pinMode(PIN_LED, OUTPUT);
pinMode(PIN_BUTTON, INPUT);
}
void loop() {
if (digitalRead(PIN_BUTTON) == LOW) {
digitalWrite(PIN_LED, HIGH); // pressed -> on
} else {
digitalWrite(PIN_LED, LOW); // released -> off
}
}
pinMode(PIN_BUTTON, INPUT)Sets GPIO 13 as an input so the board can read the button. digitalRead(PIN_BUTTON) == LOWTrue only while the button is held — a press pulls the pin LOW. digitalWrite(PIN_LED, HIGH)Lights the LED; the else branch turns it off again. Optional side path · same circuit
led = Pin(2, Pin.OUT)
button = Pin(13, Pin.IN, Pin.PULL_UP)
if not button.value():
led.value(1)
else:
led.value(0)
Pin(13, Pin.IN, Pin.PULL_UP)Reads GPIO 13 as an input with a built-in pull-up — the same job the 10 kΩ resistor does in hardware.if not button.value()True when the pin reads LOW, which is the press.Same pins, same wiring. 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
There's no trick here — just three moves the board makes over and over, faster than you can see.
digitalRead checks GPIO 13 many times a second.
LOW means pressed so the board chooses to light up.
digitalWrite pushes the pin HIGH and the LED turns on.
The whole check runs again at once and forever.
input (button) → decision (code) → output (LED)
In this wiring a press pulls GPIO 13 toward ground, so the sketch checks for LOW on purpose.
Without it the input pin would float and read at random. The resistor gives it a steady resting value.
06 Know it worked
Nothing prints to the screen today — the proof is the LED under your finger.
This press is momentary — the LED only stays on while you hold it. Tomorrow's lamp will make it latch.
07 Make the idea yours
Same working circuit, one new habit: predicting a result before you test it. It fits inside today's 30 minutes.
Before each press, say out loud whether the LED is on or off. Then press and check whether you were right.
Picture removing the 10 kΩ resistor. Predict what GPIO 13 would read with nothing holding it, and why that would be a problem.
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-DAY04-BUTTON
How the agent should behave: guide one physical connection at a time, wait for you to confirm, explain terms on request, and always check wiring, board, port, and USB before changing code.