I use onewire library on micropython, what append if thé device is disconnected…
- User
I use onewire library on micropython, what append if thé device is disconnected physically ?
- Assistant
When you use the
onewirelibrary in MicroPython and the device (like a 1-Wire sensor such as a DS18B20) is physically disconnected, the behavior typically depends on what kind of operation you're performing in the code: - User
I want to poll the température sensor connected by onewire, every second and account for possible disconnection
- Assistant
Sure! Here's a robust example to poll a DS18B20 temperature sensor connected via 1-Wire every second, and handle the sensor disconnection gracefully by checking presence before each reading:
python