DS2482-RK
|
Holds the address and temperature for a single DS18B20 the 1-wire bus. More...
#include <DS2482-RK.h>
Public Member Functions | |
DS2482Device () | |
Constructs an empty DS2482Device object. | |
virtual | ~DS2482Device () |
Destructor for DS2482Device. | |
DS2482Device (const DS24821WireAddress &addr) | |
DS2482Device (const DS2482Device &other) | |
Constructs a DS2482Device object from another DS2482Device (copy constructor). | |
DS2482Device & | operator= (const DS2482Device &other) |
Copies another DS2482Device object values into this one. | |
String | toString () const |
void | clear () |
Clears the address, temperature, and valid flags. | |
float | getTemperatureC () const |
Gets the temperature in degrees Celsius. More... | |
float | getTemperatureF () const |
Gets the temperature in degrees Fahrenheit. More... | |
void | setTemperatureC (float value) |
Sets the temperature in degrees Celsius. More... | |
bool | getValid () const |
Gets the valid flag for this temperature reading. More... | |
void | setValid (bool value) |
Sets the valid flag. | |
DS24821WireAddress | getAddress () const |
Gets a copy of the DS24821WireAddress address. | |
void | setAddress (const DS24821WireAddress &addr) |
Sets the 1-wire address. More... | |
Protected Attributes | |
DS24821WireAddress | addr |
The 1-wire address (8 bytes) | |
float | temperatureC |
The last temperature in degrees Celsius. | |
bool | valid |
True if the last temperature read was successful. | |
Holds the address and temperature for a single DS18B20 the 1-wire bus.
This hold the address, the last temperature, and whether the last retrieval was valid or not.
DS2482Device::DS2482Device | ( | const DS24821WireAddress & | addr | ) |
Constructs a DS2482Device object from a 1-wire address DS24821WireAddress.
|
inline |
Gets the temperature in degrees Celsius.
Note that the resolution depends on the conversion bit settings. It ranges from 1/2 degree (9-bit) to 1/16 degree (12-bit)
|
inline |
Gets the temperature in degrees Fahrenheit.
The DS18B20 uses Celsius internally, so the resolution is reflected in that. The degrees F is the actual converted value and may have more decimal places.
|
inline |
Gets the valid flag for this temperature reading.
When getting a list of temperatures using DS2482GetTemperatureForListCommand, it's possible that not every sensor will return a value. The getValid allows you to figure out which ones are valid.
|
inline |
Sets the 1-wire address.
addr | The address to set. |
The addr is copied, so it does not need to be preserved after this call completes.
|
inline |
Sets the temperature in degrees Celsius.
value | Temperature in degrees Celsius (as a float) |
String DS2482Device::toString | ( | ) | const |
Returns a string representation of this object including the address, temperature, and valid flag.