OneWire Interface
Posted: Sat Feb 12, 2022 2:04 am
I'm having problems deciding if there is a problem with micropython's handling of DS18x20 devices. I cannot find anything regarding this in this forum, nor the web at large, so I figured i'd ask.
I was hoping to control a heater with temperature samples from a DS18B20 device. I'm using an RP2040 for my controller, I think I have it updated to the latest micripython (I just checked the INFO_UF2.TXT file, but that doesn't seem to carry the micropython version - but here maybe I am getting confused with circuitpython).
Anyway. When i use the ds18x20.scan() method, nothing returns - I just see empty brackets. But if I use the onewire.scan() method, i actually get something in the bytestream. Furthermore, if I connect this sensor to a board programmed with arduino, it works fine as well, and i get a temperature reading.
So, maybe if someone can help answer why arduino works fine, and the one-wire scan method in MicroPython works fine, but the ds-method does nothing?
I really don't know enough about python (for whatever reason i have a hard time dealing with the bytearray object) to add further info.. But i know enough to be sure i have this connected properly, with 4.7kohm resistor pulling up the data line.
I was hoping to control a heater with temperature samples from a DS18B20 device. I'm using an RP2040 for my controller, I think I have it updated to the latest micripython (I just checked the INFO_UF2.TXT file, but that doesn't seem to carry the micropython version - but here maybe I am getting confused with circuitpython).
Anyway. When i use the ds18x20.scan() method, nothing returns - I just see empty brackets. But if I use the onewire.scan() method, i actually get something in the bytestream. Furthermore, if I connect this sensor to a board programmed with arduino, it works fine as well, and i get a temperature reading.
So, maybe if someone can help answer why arduino works fine, and the one-wire scan method in MicroPython works fine, but the ds-method does nothing?
I really don't know enough about python (for whatever reason i have a hard time dealing with the bytearray object) to add further info.. But i know enough to be sure i have this connected properly, with 4.7kohm resistor pulling up the data line.