
ESP32-S3 board
The brain that runs your uploaded sketch.
TinySkiff ESP32-S3 Lab · Day 7 of 30
Today the LED stops snapping. You keep yesterday's single-LED circuit, upload a sketch that sweeps the pin's brightness up and then down, and the light fades in and out like a slow breath — the board's first move beyond plain on and off.
TSK-DAY07-BREATHE
Hand this to an agent so it can pull the lesson packet and coach you step by step.
01 First, know the pieces
Five things, all of them familiar from Blink. 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 fade — it only works one way round.

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

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. This is the same single-LED circuit you built for Blink, so if it's still wired you're ready.
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 before you plug in USB.
Open Sketch_04.1_BreathingLight.ino in Arduino IDE and upload it.
Watch the LED fade up and down, over and over.
04 Read just enough code
The whole sketch is short. A few lines set up a hardware PWM channel on the pin; two loops sweep its brightness up and then back down. Switch to MicroPython if you'd rather see the same idea in Python — the wiring never changes.
#define PIN_LED 2
#define CHN 0 // PWM channel
#define FRQ 1000 // switching frequency, Hz
#define PWM_BIT 8 // resolution: 0-255
void setup() {
ledcAttachChannel(PIN_LED, FRQ, PWM_BIT, CHN);
}
void loop() {
for (int i = 0; i < 255; i++) { // fade in
ledcWrite(PIN_LED, i);
delay(10);
}
for (int i = 255; i > -1; i--) { // fade out
ledcWrite(PIN_LED, i);
delay(10);
}
}
ledcAttachChannel(PIN_LED, FRQ, PWM_BIT, CHN)Attaches GPIO 2 to a hardware PWM channel so the board can switch it fast on its own. ledcWrite(PIN_LED, i)Sets the brightness from 0 (dark) to 255 (full) by changing how much of each instant the pin is on. for (int i = 0; i < 255; i++)The first loop sweeps brightness up and the second sweeps it back down; delay(10) sets how fast each step passes. Optional side path · same circuit
pwm = PWM(Pin(2), 10000)
while True:
for i in range(1024): # fade in
pwm.duty(i)
sleep_ms(1)
for i in range(1023, -1, -1): # fade out
pwm.duty(i)
sleep_ms(1)
PWM(Pin(2), 10000)Sets up PWM on GPIO 2 at 10 kHz — the same fast-switching trick the Arduino sketch uses.pwm.duty(i)Sets brightness by duty, which is how much of each instant the pin is on.Same pin, same wiring. MicroPython here uses a 10-bit duty (0–1023), so the numbers differ from Arduino's 0–255 while the idea is identical. 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 half-voltage trick here — just a pin flipping faster than you can see, held on for a bigger or smaller share of each moment.
The pin itself can only be fully on or fully off.
PWM flips it far quicker than your eye can follow.
The more of each instant the pin stays on the brighter it looks.
Sliding that share from none to all and back is the breath.
brightness = duty cycle = the share of each instant the pin is on
Pulse-width modulation switches the pin on and off so fast that your eye blends the flicker into a steady, dimmable glow.
The ESP32-S3 has dedicated PWM hardware that keeps switching the pin on its own, so the sketch only has to set a brightness and move on.
06 Know it worked
Nothing prints to the screen today — the proof is the LED fading in front of you.
The change should be a smooth slide, never a hard on/off snap. If it snaps, you're likely still running the Blink sketch.
07 Make the idea yours
Same working circuit, one number to play with: the fade speed. It fits inside today's 20 minutes.
Change both delay(10) lines together — try 5 for a quick breath, 20 for a slow one — and upload until the fade feels like a resting breath.
Add a short delay(300) between the fade-in and fade-out loops so the light pauses at full brightness before it sinks again.
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-DAY07-BREATHE
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.