Commit Graph

12 Commits

Author SHA1 Message Date
vsky 52f41a840c Re-write DS18B20 asynchronous example (#1820) 2017-03-17 07:50:31 +01:00
Sebastian Schildt 0863a4c221 Fix unit constants to be consistent with code
Extend example to show querying different units or specific sensors
2016-01-17 14:39:39 +01:00
Nick Andrew 0a7b730e23 Support DS18S20 and fix negative temp handling
The DS18S20 has only 1 fractional bit whereas DS18B20 has 4, and their
temperature register alignment differs. Check the family code to choose
the correct multiplier for both devices.

Closes #610

Negative temperatures (less than 0°C) are returned as a sign-extended
two's complement number. Subtract 0x10000 to recover the proper
negative value.

Signed-off-by: Nick Andrew <nick@nick-andrew.net>
2015-11-16 23:32:20 +11:00
Tamas Szabo 67ab2d018e Update ds18b20.lua 2015-02-21 17:05:16 +01:00
sza2 5a629e4297 Fix for negative values 2015-02-14 10:48:41 +01:00
Tobias Mädel 4bde88cd81 Fixed DS18B20 handling because of new floating point handling
Hi,

because of the new floating point API, the old ds18b20 code returns strange values like "19.8250.8250". 
This change fixes that. 

Best regards,
Tobias
2015-02-01 18:20:45 +01:00
HuangRui 8cc661923b The read function returns an incorrect temperature. Fixed #149. 2015-01-31 10:46:43 +08:00
HuangRui d4dcf55764 Formatted ds18b20.lua. 2015-01-26 18:16:55 +08:00
HuangRui f09f6443d1 Move ds18b20.CN.md to ds18b20.ZH.md 2015-01-21 18:45:08 +08:00
baracudaz 6525747859 DS18B20 module examples
Adding couple of example on how to use DS18B20 module
2015-01-10 10:58:08 +01:00
HuangRui c18f198af8 Fix the bug of memory release in documents. 2014-12-23 16:24:53 +08:00
funshine 152107feab rename folder name to pre_build 2014-12-22 20:28:37 +08:00