Reformating of arduino_master code. tested works