Arduino 1-Wire Device Libraries

DS2450 API

Constructor

DS2450(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 DS2450 device.
Parameters none
Returns boolean True if setup succeeded, False if a CRC error resulted.

update()
Initiates a/d conversion on all 4 channels and stores the results.
Parameters none
Returns void

getVoltage(int channel)
Returns the sampled voltage value for the specified channel 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 float The voltage value in volts (0-5v)

isError()
Returns True if the most recent update() invocation resulted in an error. Errors may be due to the returned data from the DS2450 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 valid voltage values were 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 unsigned 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>>