onewireio
– Low-level bit primitives for Maxim (formerly Dallas Semi) one-wire protocol.¶
Protocol definition is here: https://www.maximintegrated.com/en/app-notes/index.mvp/id/126
Available on these boards
- class onewireio.OneWire(pin: microcontroller.Pin)¶
Create a OneWire object associated with the given pin.
The object implements the lowest level timing-sensitive bits of the protocol.
- Paramètres:
pin (Pin) – Pin connected to the OneWire bus
Note
The OneWire class is available on
busio
andbitbangio
in CircuitPython 7.x for backwards compatibility but will be removed in CircuitPython 8.0.0.Read a short series of pulses:
import onewireio import board onewire = onewireio.OneWire(board.D7) onewire.reset() onewire.write_bit(True) onewire.write_bit(False) print(onewire.read_bit())
- __exit__() None ¶
Automatically deinitializes the hardware when exiting a context. See Lifetime and ContextManagers for more info.