Arduino 1-Wire Device Libraries

DS2423 API

Constructor

DS2423(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(uint8_t counter)
Initializes the DS2423 device. Choose which counters this device will use via the counter parameter.
Parameters uint8_t counter DS2423_COUNTER_A for counter A only, DS2423_COUNTER_B for counter B only, or DS2423_COUNTER_A | DS2423_COUNTER_B for both counters. Defaults to DS2423_COUNTER_A if none specified.
Returns void

update()
Reads the values of the selected DS2423 counters.
Parameters none
Returns void

getCount(uint8_t counter)
Returns the counter value for the chosen counter read on the most recent update() invocation. If the device has been initialized via begin() but update() has not been invoked then 0 is returned.
Parameters uint8_t counter DS2423_COUNTER_A for counter A, or DS2423_COUNTER_B for counter B. Defaults to DS2423_COUNTER_A if none specified.
Returns uint32_t The counter value of the selected counter.

isError()
Returns True if either counter read from the most recent update() invocation resulted in an error. Errors may be due to the returned data from the DS2423 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 all configured counter 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>>