First version of code. Readme and circuit diagram to follow...