This code is made to control an Arduino nano-based monorail with two step motor-controlled arms that stop at each time it senses a magnet. For each magnet stop the arms pokes each side once, one at a time. There is a built-in pause after each run (after it homes) that decides how often it runs.
Check the PDF (Swedish) for instructions on how to setup and run the monorail. Also how to calibrate the monorail poke position.