Previous Post

Coordinating train departure time wirelessly!

Next Post
Coordinating train departure time wirelessly!
1 / 2
DESCRIPTION

One smart train is not enough of a challenge, so let's run two smart trains on one piece of track. In the opposite direction!

This builds on the program we shared the other day, but it adds some Bluetooth logic to both trains. When it arrives at the train station (blue), it basically says "I'm here"! (by sending "True") The other train can wait for this signal before departing.

The train in this example broadcasts on channel 34 and listens on channel 12. The program for the other train is exactly the same, but it broadcasts on channel 12 and listens on channel 34.

You could also use this technique to have multiple trains share a single loop in one direction. They could each wait at a station until all trains are ready to depart. This way they'll never run into each other.

Pybricks PATREON 2 favs
VIEWS1
FILES2 files
POSTEDMar 28, 2024
ARCHIVEDJun 10, 2026