class documentation

class IOADC: (source)

Constructor: IOADC.unpack(data)

View In Hierarchy

Represents an Analog-to-Digital Converter (ADC) input status.

Class Method unpack Unpacks a bytes sequence into an IOADC object.
Method pack Packs the IOADC object into a bytes sequence.
Class Variable address Undocumented
Class Variable value Undocumented
def unpack(cls, data: bytes) -> IOADC: (source)

Unpacks a bytes sequence into an IOADC object.

Parameters
data:bytesThe bytes to unpack, expected to be 3 bytes (1 uint8 + 1 uint16).
Returns
IOADCAn IOADC object.
Raises
struct.errorIf the input bytes are not the expected size (3 bytes).
def pack(self) -> bytes: (source)

Packs the IOADC object into a bytes sequence.

Packs the address (uint8) and value (uint16) into a byte string. Uses little-endian byte order.

Returns
bytesA bytes object representing the packed data (1 + 2 = 3 bytes).

Undocumented

Undocumented