Arduino sketch for controlling a brushless DC motor.