An arduino sketch for a self-calibrating, learning interval timer