This is the full ArduinoBeam control program. The program first drives the rig to the limit switches, setting the zero positions. The sun position is then calculated using the PSA algorithm and the required machine positions are determined. The axes are then rotated into position using feedback from the motors rotary encoders and a crude approximation of a PI loop.
To compile this code will need the Time.h, Wire.h and DS1307RTC.h libraries.