
ESP32-S3 board
The brain that runs your uploaded sketch.
TinySkiff ESP32-S3 Lab · Day 8 of 30
Today the light gains a tail. You reuse the same LED bar from Day 6, then upload a sketch that gives each segment its own brightness with PWM — a bright head at the front, dimmer segments trailing behind, all sliding along the bar and back.
TSK-DAY08-METEOR
Hand this to an agent so it can pull the lesson packet and coach you step by step.
01 First, know the pieces
The same six things as Day 6 — you may already have them wired. 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 same strip from Day 6 — ten small LEDs, each its own segment.

One in series with each driven segment to keep every current gentle.

Temporary, solder-free connections.

Uploads the sketch to the board.
02 Make the physical circuit
This is the same LED bar circuit you built on Day 6 — if it's still on the breadboard, you're nearly done. The one difference is that today's sketch drives eight of the segments, because each needs its own PWM channel and the board has eight, so two segments stay dark.
The bar can go in backwards. The LED bar's label direction is easy to reverse. If the driven segments stay dark once you upload, rotate it 180° in the breadboard and try again. 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.
Confirm the Day 6 LED bar is still wired, or rebuild it — LED bar across the centre channel, one 220 Ω resistor per segment, common row to ground.
Keep USB unplugged while you check or move any wire.
Note that only eight segments are wired for PWM today, since the board has eight PWM channels; two segments stay dark on purpose.
Compare every wire to the chart before you plug in USB.
Open Sketch_04.2_FlowingLight2.ino in Arduino IDE and upload it.
Watch a bright segment with a fading tail glide along the bar and back.
04 Read just enough code
The sketch keeps the pins in one list, like Day 6, but adds a second list of brightness values that forms the tail. Switch to MicroPython if you'd rather see the same idea in Python — the wiring never changes.
const byte ledPins[] = {21, 47, 38, 39, 40, 41, 42, 2};
const byte chns[] = {0, 1, 2, 3, 4, 5, 6, 7};
const int dutys[] = {0,0,0,0,0,0,0,0, 1023,512,256,128,64,32,16,8, 0,0,0,0,0,0,0,0};
void setup() {
for (int i = 0; i < 8; i++) {
ledcAttachChannel(ledPins[i], 1000, 10, chns[i]);
}
}
void loop() {
for (int i = 0; i < 16; i++) {
for (int j = 0; j < 8; j++) {
ledcWrite(ledPins[j], dutys[i + j]);
}
delay(100);
}
}
ledcAttachChannel(ledPins[i], 1000, 10, chns[i])Gives each of the eight pins its own PWM channel, so every segment can hold a brightness of its own. const int dutys[] = {0,..., 1023,512,256,128,64,32,16,8, ...,0}A brightness gradient — bright to dim — with dark padding on each side; those falling numbers are the fading tail. ledcWrite(ledPins[j], dutys[i + j])Reads an eight-wide window of the gradient and slides it one step each pass, which is what makes the comet move. Optional side path · same circuit
mypwm = myPWM(21,47,38,39,40,41,42,2)
chns = [0,1,2,3,4,5,6,7]
dutys = [0,0,0,0,0,0,0,0, 1023,512,256,128,64,32,16,8, 0,0,0,0,0,0,0,0]
mypwm = myPWM(21,47,38,39,40,41,42,2)A helper wraps each of the eight pins as a PWM object so they can hold brightness in Python.dutys = [...1023,512,256,128,64,32,16,8...]The same falling gradient as the Arduino sketch — the head is brightest and the tail fades.A helper pwm.py wraps each pin as a PWM object. 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 — the board sets eight brightnesses at once, then nudges the whole pattern along the bar, faster than the eye separates the steps.
Each segment gets its own channel so it can be bright or dim.
The dutys list falls from full on down to a faint glow.
An eight-wide window of that list moves one place each pass.
The bright end leads and the dim end trails it down the bar.
eight brightnesses → a falling gradient → slide it one step → head leads, tail fades
PWM flicks each pin on and off very fast; the fraction of time it stays on sets how bright that segment looks, so a whole row can carry a smooth gradient.
06 Know it worked
Nothing prints to the screen today — the proof is the moving comet on the bar.
Two segments stay dark on purpose — only eight are on PWM, because the board has eight PWM channels.
07 Make the idea yours
Same working circuit, small edits to the sketch. Both fit inside today's time and leave the wiring untouched.
Edit the falling numbers in dutys — add more dim values for a longer tail, or fewer for a shorter one. Predict the shape before you upload.
Set delay(100) to a larger or smaller number and upload. Find the speed where the comet still reads as one moving light.
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-DAY08-METEOR
How the agent should behave: confirm the Day 6 circuit first, guide one segment at a time, wait for you to confirm, explain terms on request, and always check wiring, board, port, and USB before changing code.