clean code and add sleep mode to arduino

sleep mode allows to exit the app and set the arduino
listing for a new handshake