class documentation

class tagIOPWM: (source)

Constructor: tagIOPWM.unpack(data)

View In Hierarchy

Represents a PWM output command.

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

Unpacks a bytes sequence into a tagIOPWM object.

Parameters
data:bytesThe bytes to unpack, expected to be 17 bytes (1 uint8 + 2 doubles).
Returns
tagIOPWMA tagIOPWM object.
Raises
struct.errorIf the input bytes are not the expected size (17 bytes).
def pack(self) -> bytes: (source)

Packs the tagIOPWM object into a bytes sequence.

Packs the address (uint8), frequency (double), and dutyCycle (double) into a byte string. Uses little-endian byte order.

Returns
bytesA bytes object representing the packed data (1 + 8 + 8 = 17 bytes).

Undocumented

dutyCycle: float = (source)

Undocumented

frequency: float = (source)

Undocumented