Arduino 1-Wire Device Libraries

DS18S20 API

Constructor

DS18S20(OneWire *ow, uint8_t *address)
Parameters OneWire *ow Address of a previously constructed OneWire object.
uint8_t *address Address of an 8-byte array containing the device's 1-Wire address

Methods

begin()
Initializes the DS18S20 device.
Parameters none
Returns void

update()
Initiates acquisition of a new temperature value from the DS18S20 device.
Parameters none
Returns void

getTemperature()
Returns the temperature value from the most recent update() invocation. If the device has been initialized via begin() but update() has not been invoked then 0 is returned.
Parameters none
Returns double The temperature value in degrees Celsius

isError()
Returns True if the most recent update() invocation resulted in an error. Errors may be due to the returned data from the DS18S20 device having an invalid CRC, or if begin() was invoked but update() has not yet been invoked.
Parameters none
Returns boolean True if update() resulted in an error, False if a valid temperature value was acquired.

getTimestamp()
Returns the system value of millis() at the time of the last invocation of update(). This may be used in computations where the time difference between subsequent readings is required.
Parameters none
Returns long The value of millis() at the time of the last invocation of update(), or 0 if update() has not yet been invoked.


<<Previous Page | Index | Next Page>>