Using the Arduino to capture switch action makes the code a lot cleaner.