
ESP32-S3 board
The brain that runs your uploaded sketch.
TinySkiff ESP32-S3 Lab · Day 9 of 30
Today the board becomes a painter. You wire one small dome that holds three lights — red, green, and blue — to three PWM pins, then upload a sketch that sets each brightness and lets your eye blend them into a single colour.
TSK-DAY09-RGB
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 small. 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.

Three lights — red, green, blue — in one dome with a shared pin.

One in series with each colour leg 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. Each connection tells you where the wire goes and why.
The common pin goes to 3.3V. This is a common-anode LED, so the long common pin goes to 3.3V and not to ground — the opposite of a single LED. Each colour leg reaches its own GPIO through a 220 Ω resistor. 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.
Find the RGB LED's long pin — that's the common one shared by all three colours.
Wire the red leg through a 220 Ω resistor to GPIO 38.
Wire the green leg through a 220 Ω resistor to GPIO 39.
Wire the blue leg through a 220 Ω resistor to GPIO 40.
Run the long common pin to 3.3V, not to ground.
Compare every wire to the chart before you plug in USB.
Open Sketch_05.1_RandomColorLight.ino in Arduino IDE and upload it.
Watch the dome change colour again and again.
04 Read just enough code
The sketch sets up three PWM channels, then paints a colour by giving each one a brightness. Switch to MicroPython if you'd rather see the same idea in Python — the wiring never changes.
const byte ledPins[] = {38, 39, 40}; // R, G, B
const byte chns[] = {0, 1, 2};
void setup() {
for (int i = 0; i < 3; i++) {
ledcAttachChannel(ledPins[i], 1000, 8, chns[i]);
}
}
void loop() {
int red = random(0, 256);
int green = random(0, 256);
int blue = random(0, 256);
ledcWrite(ledPins[0], 255 - red); // common anode: LOW = brighter
ledcWrite(ledPins[1], 255 - green);
ledcWrite(ledPins[2], 255 - blue);
delay(200);
}
const byte ledPins[] = {38, 39, 40}The three pins are the red, green, and blue legs in that order. ledcWrite(ledPins[0], 255 - red)Writes 255 minus the value because this common-anode LED lights when its pin goes LOW. red = random(0, 256)Each colour gets a fresh brightness from 0 to 255, and setting all three at once mixes the shade. Optional side path · same circuit
pins = [38, 39, 40] # R, G, B
pwm0 = PWM(Pin(pins[0]), freq=1000)
r = random.randint(0, 1023)
pwm0.duty(1023 - r) # common anode: invert with 1023 - value
pwm0.duty(1023 - r)MicroPython's duty here is 10-bit, so it inverts with 1023 minus the value instead of 255.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 — three small lights sit close together and PWM sets how bright each one glows.
Red green and blue sit side by side under one lens.
A PWM channel dials each colour from off to full.
The three glows overlap and read as one colour.
Red green and blue at full together look white.
colour = red + green + blue at chosen brightnesses
The common pin sits at 3.3V, so a colour is brightest when its own pin is pulled LOW. Writing 255 minus the brightness flips the scale so bigger still means brighter.
An RGB LED is three coloured LEDs packaged together, each with its own leg and a shared common pin.
06 Know it worked
Nothing prints to the screen today — the proof is the colour in the dome.
The colours look random on purpose — each one is a fresh mix of red, green, and blue.
07 Make the idea yours
Same working circuit, one design choice: picking a colour that carries meaning. It fits inside today's 25 minutes.
Decide on a colour that would read as ready or as a warning, then write down the red, green, and blue numbers from 0 to 255 that would make it.
Upload the gradient variant Sketch_05.2_GradientColorLight.ino and watch the colour slide smoothly instead of jumping.
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-DAY09-RGB
How the agent should behave: guide one physical connection at a time, wait for you to confirm, explain the common-anode inversion on request, and always check the common pin, wiring, board, and USB before changing code.