The Underground Market
Somebody saw the signal. Not Sintech — an engineer, someone who used to build this kind of thing for a living, who spotted the light over the rooftops and spent a week asking the right people until the trail led back to the shop.
He arrives with news and a warning. The factions of the Resistance are interested. They are also scattered, cautious, and pointed in different directions across the city, and a single lamp blinking on and off can tell them precisely one thing: something is happening. It cannot say what, or where, or to whom.
"We need to send much more complex messages to them, rather than just a single beam of light."
So today the beacon becomes an array. Three LEDs, pointed three ways, blinking in sequence — and a pattern, unlike a single flash, can carry meaning.
Why One Resistor Is Enough
Get out two more LEDs. You will not need two more resistors, and that surprises Kai enough that he asks about it.
Yesterday's resistor is not attached to the LED, remember — it sits between the ground rail and the Pico's ground pin. Everything that returns to ground has to pass through it. So all three LEDs can share that one resistor, because they all come home the same way.
The catch: one at a time.
A shared resistor only works while a single LED is lit. Turn two on at once and they have to split the same current between them, and both come out visibly dimmer. That is fine today, because the whole point is a sequence — but it is the reason Day 4 goes back to a resistor each.
Wiring the Array
Three LEDs, one shared resistor, still no jumper wires.
- Start with the resistor: bridge the breadboard's ground rail to a GND pin on the Pico with the 220Ω resistor, exactly as you did on Day 1. If it is still there from yesterday, leave it alone.
- Put the longer legs of your three LEDs into physical pins 17, 19 and 20. In code those are GP13, GP14 and GP15 — and GP15 is yesterday's LED, which does not have to move.
- Put all three shorter legs into rows along the blue line, on the ground rail.
No jumper wires again today. Every leg goes straight into the board, which is cramped but fast, and speed is rather the point when you are trying to reach several factions before Sintech reaches you.
Writing the Pattern
The imports are yesterday's tidier form, plus time comes back — this program is all about timing again.
from machine import Pin
import timeThen three variables instead of one. Nothing new here except repetition, which is itself worth noticing: naming things separately is how a program keeps track of several of the same kind of object.
led1 = Pin(13, Pin.OUT)
led2 = Pin(14, Pin.OUT)
led3 = Pin(15, Pin.OUT)The loop lights each LED for half a second in turn, switching each one off before the next comes on — which is what keeps you inside the one-at-a-time rule the shared resistor imposes.
from machine import Pin
import time
led1 = Pin(13, Pin.OUT)
led2 = Pin(14, Pin.OUT)
led3 = Pin(15, Pin.OUT)
while True:
led1.on()
time.sleep(0.5)
led1.off()
led2.on()
time.sleep(0.5)
led2.off()
led3.on()
time.sleep(0.5)
led3.off()Run the Sequence
Send it across. The three lights should chase each other in order, half a second each, then start again — a signal pointing three different ways in turn.
That is a pattern, not a pulse.
One light says "here". Three lights in a known order can say which faction, which direction, or which of three messages — without a single word crossing a network Sintech can read.
Now go and break it on purpose, because that is where the understanding is. Drop the delays to 0.05 and watch the sequence turn into a blur. Reverse the order of the three blocks and watch the signal appear to run the other way. Then try removing one of the off() lines and see what a shared resistor really does — two LEDs lit at once, both noticeably dimmer than one. That is the rule from earlier, demonstrating itself.
What You Actually Built
Three lights is not three times harder than one light. It is the same idea, given more names and put in an order, and that is most of what programming turns out to be: something small that works, repeated deliberately.
The engineer takes the news back to the factions and the Resistance begins to move. Which creates the next problem, and it is the same one as before, only larger. Three lights blinking constantly are three times easier to spot than one, and Sintech is already looking.