I built a MOC electric track switch (points) then using the PoweredUp App and three trains with colour sensors I worked out how to control them automatically so they take turns visiting each station.
Basic operation using block code in the PoweredUp App:
When a train senses the yellow strip:
Is there a train in station 1?
- - No: switch points for station 1. When it senses a red strip. Stop
- - Yes: Is there a train in station 2?
- - - - No: switch points for station 2. When it senses a red strip. Stop
- - - - Yes: switch points for bypass. When it senses a red strip. Start train in station 1 - when that train senses a red strip, start train in station 2.
Негізгі бет Автокөліктер мен көлік құралдары Three Lego Trains automatically sharing two stations using PoweredUp
Пікірлер