DS1820
Last updated
Last updated
Driver to control 1-Wire temperature sensor.
Type
Name
bool
bool
void
void
float
uint8_t
Constructs a generic sensor.
Note:
Parameters:
pin Name of data pin
Return value:
Constructs a specific model.
Note:
Parameters:
model One character model name: 'S', 's', 'B' or 'b' pin: Name of data pin
Return value:
Note:
Parameters:
Note:
Parameters:
Sets temperature-to-digital conversion resolution.
Note:
The configuration register allows the user to set the resolution of the temperature-to-digital conversion to 9, 10, 11, or 12 bits. Defaults to 12-bit resolution for DS18B20. DS18S20 allows only 9-bit resolution.
Parameters:
res Resolution of the temperature-to-digital conversion in bits.
Return value:
Starts temperature conversion.
Note:
The time to complete the converion depends on the selected resolution: 9-bit resolution -> max conversion time = 93.75ms 10-bit resolution -> max conversion time = 187.5ms 11-bit resolution -> max conversion time = 375ms 12-bit resolution -> max conversion time = 750ms
Parameters:
Reads temperature from the chip's Scratchpad.
Note:
Parameters:
Reads temperature from chip's scratchpad.
Note:
Verifies data integrity by calculating cyclic redundancy check (CRC). If the calculated CRC dosn't match the one stored in chip's scratchpad register the temperature variable is not updated and CRC error code is returned.
Parameters:
temp The temperature variable to be updated by this routine. (It's passed as reference to floating point.)
Return value:
error code: 0 - no errors ('temp' contains the temperature measured) 1 - sensor not present ('temp' is not updated) 2 - CRC error ('temp' is not updated)
The documentation for this class was generated from the following file: D:/w/hw-libs/\_libs\_/libraries/DS1820.h
(PinName pin) Constructs a generic sensor.
(char model, PinName pin) Constructs a specific model.
(void) Detects and initializes the actual model.
() Informs about presence of a sensor.
(uint8_t res) Sets temperature-to-digital conversion resolution.
(void) Starts temperature conversion.
(void) Reads temperature from the chip's Scratchpad.
(float & temp) Reads temperature from chip's scratchpad.
must be called to detect and initialize the actual model
No need to call to detect and initialize the model
Detects and initializes the actual model.
Informs about presence of a sensor.
shall be called before using this function if a generic instance was created by the user. No need to call for a specific instance.