A project to experiment with LEGO train automation.
After a little bit of research I decided to give PyBricks a try since it allows me to use original LEGO parts to control the trains and the switches. I set myself the goal to control two trains on a simple track with one switch. A [video}(https://youtu.be/BIv__JPrNug) demonstrating the system is available on YouTube.
I created a flowchart to better communicate the different states and communications between the trains and the switch: