Thanks Pythoncoder !
It's a good improvement of my code.
But it's still not working, and I know why, I'm testing my code in the REPL...and I just discovered the paste mode...I had a problem with auto-indent en fact.
@Miguel : now I'm not anymore using the multithreaded firmware and it's working, no need of the not-multitheaded one.
Onewire and DS18B20
Re: Onewire and DS18B20
Hi,
I'm using a Lopy.
I can't get the ds18b20 to work.
I got a par version. so no extra vcc is needed.
the data line is pulled up with a 4K7 resisitor to 3V3
my dataline is at G22
this code gives me no errors:
from ds18x20 import DS18X20
d=DS18X20(Pin('G22', mode=Pin.OUT))
result=d.read_temps()
print(result)
but doesn't return any values...
there is only 1 sensor connected.
what is wrong?
any help is appreciated.
I'm using a Lopy.
I can't get the ds18b20 to work.
I got a par version. so no extra vcc is needed.
the data line is pulled up with a 4K7 resisitor to 3V3
my dataline is at G22
this code gives me no errors:
from ds18x20 import DS18X20
d=DS18X20(Pin('G22', mode=Pin.OUT))
result=d.read_temps()
print(result)
but doesn't return any values...
there is only 1 sensor connected.
what is wrong?
any help is appreciated.
-
- Posts: 10
- Joined: Fri Dec 15, 2017 11:11 am
Re: Onewire and DS18B20
Hello,
While the DS18x20 is "measuring" it draws extra power. ~1.5mA
Thus the "-par" version needs temporarily a much stronger pull-up.
Using a non-par version eliminates this problem.
But as the "-par" is quite nice:
I would like to see software support using an extra pin for the "strong pull-up"
Anyone up for that challenge?
See fig 6 & text in:
https://datasheets.maximintegrated.com/ ... S18B20.pdf
While the DS18x20 is "measuring" it draws extra power. ~1.5mA
Thus the "-par" version needs temporarily a much stronger pull-up.
Using a non-par version eliminates this problem.
But as the "-par" is quite nice:
I would like to see software support using an extra pin for the "strong pull-up"
Anyone up for that challenge?
See fig 6 & text in:
https://datasheets.maximintegrated.com/ ... S18B20.pdf