Skip to content

StdDevTemperature()

Arnd edited this page Dec 3, 2016 · 1 revision

StdDevTemperature([skipDeviceNumber])

This function reads all of the 1-Wire DS-Family devices and returns the standard deviation of the temperature readings. If the optional skipDeviceNumber is set to a deviceNumber then that specific thermometer is excluded from the computations. This allows for 1 device to be ignored, for instance if one is placed on the processor board or attached to a refrigeration evaporator plate and has a different value from all the others.

Note that this returns a floating point value. This will significantly increase the code size when it used in a sketch that otherwise doesn't use any floating point numbers; as the library is only loaded when required and any unused functions are optimized out during the compile/load cycle.


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
Serial.print("Found ");
Serial.println(thermometers);
Serial.print("Temperature standard deviation is ");
float temp = ds.StdDevTemperature();
Serial.print(temp);
Serial.print(".");