Skip to content

SetDeviceCalibration()

Arnd edited this page Jan 1, 2017 · 1 revision

SetDeviceCalibration(deviceNumber,offset)

This will set user byte 1 of device deviceNumber to the offset value. The value of user byte 2 is set so that the two XORd together result in 0xFF, making a primitive checksum value. The offset is in 0.0625°C units.


Example:

const uint8_t ONE_WIRE_PIN = 8;             // 1-Wire microLAN pin
DSFamily_Class ds(ONE_WIRE_PIN);            // Instantiate
uint8_t thermometers = ds.ScanForDevices(); // find all devices
for (uint8_t i=0;i<thermometers;i++) {
  ds.SetDeviceCalibration(i,0);             // turn off calibration
} // of for-next each thermometer