Skip to content

GetDeviceResolution()

Arnd edited this page Dec 12, 2020 · 2 revisions

GetDeviceResolution(DeviceIndex);

This function return the bits of resolution (9, 10, 11 or 12) set for DeviceIndex. This will return a 0 for invalid device numbers and is set during the call to ScanForDevices().


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++) {
   Serial.print("Device "); 
   Serial.print(i);
   Serial.print(" has "):
   Serial.print(ds.GetDeviceResolution(i));
   Serial.println(" bits of precision set.");
} // of for-next loop