added PWM calibration code to testPeriodic