added cleanup function with trap to run on exit
Merge branch 'master' of github.com:hamishcunningham/pi-tronics
fix loggin bug