Receive DMX512 lighting data on a GPIO pin

exception dmx_receiver.DmxProtocolError

Raised when a broken DMX frame is detected

class dmx_receiver.DmxReceiver(pin, dmx_basis=False, slot=None)

Receive 16 slots of DMX512 lighting data on a GPIO pin.

Either explicitly request and retrieve data from the wire, or use this object as an iterator.

Multiple objects may be used to receive more than 16 slots. Slots received from multiple objects need not be contiguous.

Configure up the RP2040 state machine:

:param ~microcontroller.pin pin: The pin to retrieve data from.
:param boolean dmx_basis: If True start slot numbers at 1 not 0.
:param int slot: The first DMX slot of 16 to listen for.
bind(slot=None)

Set up the RP2040 state machine to retrieve data.

Parameters:

slot (int) – The first DMX slot of 16 to listen for.

Return type:

None

recvfrom()

Receive data from the wire if available.

Returns:

16 slots of DMX data

Return type:

bytes or None

Raises:

DmxProtocolError – a broken DMX frame is detected

property slot

The slot requested