Added some button handling, set up for digital outputs