sabertooth2x12
- Sabertooth 2x12¶
Sabertooth2x12¶
Attributes
Methods
- defsend_packet
- defset_motor1
- defset_motor2
- class sabertooth2x12.Sabertooth2x12(filename: str, address: int = 128, baudrate: int = 9600, sim: bool = False)[source]¶
Helper class to interface with the Sabertooth 2x12 regenerative motor driver.
- sim¶
Whether the device is simulated. If so, a simulated serial connection is constructed, rather than a physical serial connection.
- Type
- Parameters
- static make_packet(address: int, command: int, data: int) bytes [source]¶
Constructs a packet given an address, command, and data. The checksum is added on to the end of the packet. All four integers are packed as unsigned integers in the resulting packet.
- send_packet(command: int, data: int) None [source]¶
Sends a packet over the serial connection using the class’ address.
SimulatedSabertooth2x12¶
Methods
- defwrite
- class sabertooth2x12.SimulatedSabertooth2x12(*args, **kwargs)[source]¶
Creates a simulated serial device representing the Sabertooth 2x12 regenerative motor driver.
Implements
mil_tools.SimulatedSerial
.