Simple beat detection on the Teensy 3.1