This is the original code from John Purbrick for the DC Throttle.
It supports control of the train either from the Serial port of the Arduino or from an on board pot, with reversal by changing pins.
Various changes to the way in which the software is presented have been made but the basic concept and hardware interface is unaltered
Martin Da Costa and others have been analysing the hardware and proposing changes. This is for the original hardware build.