Module onewire_ds18b20

Communicate with the DS18B20 - Programmable Resolution 1-Wire Digital Thermometer .

Description

Communicate with the DS18B20 - Programmable Resolution 1-Wire Digital Thermometer .

Function Index

convert/2Initiate a temperature measurement.
read_scratchpad/1Read the scratchpad.
temp/1Read the temperature in °C from the scratchpad.

Function Details

convert/2

convert(ID::[byte()], Timeout::any()) -> ok

Initiate a temperature measurement.

Example

  1> onewire_ds18b20:convert([40,255,190,25,96,23,3,203], 500).
  ok

read_scratchpad/1

read_scratchpad(ID::[byte()]) -> {LSB::binary(), MSB::binary(), Config::binary()}

Read the scratchpad.

Returns the two bytes of the temperature register (LSB and MSB) and the one byte of the configuration register.

temp/1

temp(ID::[byte()]) -> float()

Read the temperature in °C from the scratchpad.

Example

  onewire_ds18b20:temp([40,255,190,25,96,23,3,203]).
  22.375


Generated by EDoc