OneWire Lib #182
Replies: 5 comments
-
Posted at 2013-11-27 by @gfwilliams I don't think you're doing anything wrong at all - that's just what the OneWire object looks like. You can then just call methods on it - see the DS18B20 library for an example: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2013-11-28 by Raffaele Woow...I supposed it was same sort of error message. Going deep further the following code for DS1820 works like a charm ;)
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2013-11-29 by @gfwilliams Thanks! Do you know what the difference is between the DS1820 and the DS18B20? I'm just wondering if it's possible to make a new library that does both (as my library only reads the first 2 bytes)... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2013-11-29 by tickTock Hello Gordon,
as I know, DS1820 is the predecessor of the DS18B20. The resolution of the 18B20 is configurable between 9, 10, 11 and 12 bits. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2013-11-29 by Raffaele Sure Gordon...it is possible to make a lib to handle both DS1820 and DS18B20! The only difference (as @ticktock correctly sad) is the resolution:
What i've done in the previous post, was to raise the fixed 9 bit resolution by using some additional register value in the scratchpad. In a nutshell for:
Note: is it possible that formulas above doesn't work for temp below zero....in that case you have to play with bits (2 complements...and so on) ...finally reading the LSB of 64bit ROM you can understand if you are using either the DS1820 sensor (0x10) or DS18B20 (0x28) one. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2013-11-26 by Raffaele
Hi,
I'm using ST Discovery VL to run espruino. When i try to initialize the OneWire object using
var ow = OneWire(A10);
it returns the following message:
{"proto":prototype,"constructor":OneWire,"pin":A10}
What i'm doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions