sensor calibration code