Add the brake function to the arduino sketch.