Well, I bought an Arduino starter kit during the lockdown so I could have a go at making a self-driving car. Not quite as ambitious as it sounds because it was Magnorail-based, but I did want it to start and stop, accelerate and decelerate, and reproduce oversteer and understeer. I also wanted a dashboard display to show what was going on, with a speedometer and lap counter. And it all worked out fine in the end, sketch attached.
But (a very big but) I found it all incredibly wearying. I finished it feeling the dashboard display only existed for debugging, and the whole thing was really a very laborious script not a properly responsive and portable program. I think, the whole structure of the code should be based on a much smaller loop with interupts
arriving from the position sensors (the four reed switches) telling the motor (moving the car) to change speed and the servo (over/understeer) to move the chain.
The code does set up the Arduino to drive a Magnorail motor, and new LCD characters with true descenders, and maybe these are reusable to folk here. It all works nicely, but it ended up too hardware-specific for my liking - it only works because I have arranged the time spent changing chain speed and moving the servo to not interfere with reading the next reed switch.
A part of me says, this would be a lot easier with multiple Arduinos, one for the motor, one for the servo, one checking for switch trips. A person with the necessary experience might see these as objects well within the processing capacity of a single Arduino; and there are I/O pins spare; but somehow the fun just seeped away and I never brought myself to do the scenics.
Clyde Humphries, the proprietor of Magnorail Oz, made some videos using my footage which are quite fun, for example:
Whether the Arduino was or wasn't the appropriate approach to this, well I'm not sure; but I suspect it could be, in more experienced hands. This was my first go with C and C++ . . . so I have had a go, but never again
Edited as underlined to try to clarify.