Takes inputs from controls like those found on a railway locomotive and simulates train inertia. Outputs a PWM signal for a DC motor driver to control a model railway.
Written for Arduino Uno using Arduino 1.8.5. It also requires the MsTimer2 library found here.
For a brief explanation of the algorithm used, check out this C# software demo and this video.