calibrate Function

Top  Previous  Next

Gets a calibration value for the ADC voltage reference.



Return Value

The calibration value as measured using the current voltage reference.


The calibrate function measures an accurate internal calibration voltage using the currently selected voltage reference, as set by the reference property. This allows the actual value of the reference voltage to be computed accurately as long as it is greater than calValue, the internal calibration voltage. The reference voltage is computed as follows:


Vref = Cell.ADC.calValue * Cell.ADC.max / Cell.ADC.calibrate();


Computing the actual reference voltage is useful if the selected reference voltage is not very accurate. For example, if the reference is based on the power supply voltage it will be no more accurate than the power supply regulator, which can have a tolerance of as much as 5%.

See Also

reference Property, calValue Constant, max Constant