class documentation
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 | duty |
Undocumented |
Class Variable | frequency |
Undocumented |
Unpacks a bytes sequence into a tagIOPWM object.
Parameters | |
data:bytes | The bytes to unpack, expected to be 17 bytes (1 uint8 + 2 doubles). |
Returns | |
tagIOPWM | A tagIOPWM object. |
Raises | |
struct.error | If the input bytes are not the expected size (17 bytes). |
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 | |
bytes | A bytes object representing the packed data (1 + 8 + 8 = 17 bytes). |