Mixing sensors with trains for precision driving (Patreon)
Published:
2023-12-22 07:37:04
Imported:
2026-06
Content
In our previous tutorial, we showed how you can accurately detect colors on the track. But you can take it a step further!
By counting the sleepers as you drive, you get a measure of the position and speed of the train. Compare it against an incrementing reference like a timer, and you can accurately control the speed of your train.
This allows your train to drive at low speeds that it normally can't do. (it would just stop!)
It works even as you add more wagons. Or peanut butter jars!