Added the digital IO for calibration, and the calibration routine.