micropython / micropython

MicroPython - a lean and efficient Python implementation for microcontrollers and constrained systems
https://micropython.org
Other
19.38k stars 7.76k forks source link

OneWire - dallas sensor return positive value on minus degree #2765

Closed syndycat closed 7 years ago

syndycat commented 7 years ago

Hello,

I checked the onewire python code with DS18B20 - outside temperature -12 degrees celsius ... value returned by lib is 4083.

However inside was 23.5 degrees celsius and the value was OK

dpgeorge commented 7 years ago

Which board/hardware/port are you using and where did you get the ds18b20 driver from?

peterhinch commented 7 years ago

A search on DS18B20 in the forum yields posts on this issue and solutions.

syndycat commented 7 years ago

Hello guys,

Myboard is pycom WiPy... but I beleive this doesn't matter . The digital msb / lsb is the same.

I fixed here https://github.com/micropython/micropython/pull/2770

Kind regards, Cata

dpgeorge commented 7 years ago

Myboard is pycom WiPy... but I beleive this doesn't matter

The reason I asked is because there're different drivers for esp8266 and "all other boards", and the esp8266 driver had this bug fixed recently.

Hopefully soon we can merge the drivers so there is only one, and it works on all boards. Until then I merged your fix, thanks!