Simplified serial mode uses TTL level single-byte serial commands to set the motor speed and direction. This provides a simple way to interface to PCs, without a need to implement a packet-based communication protocol. Motors and sabertooth
To make it more interesting I was using two motors and tracks. The serial connection was provided by the Propeller Plug.
1. Setup the Sabertooth by setting switches 2 and 4 to the DOWN position.
2. Connect a power supply, motors, the Sabertooth board and the Propeller Plug:
Propeller Plug | Sabertooth 2x5 |
RX | S2 |
TX | S1 |
RES | |
VSS | 0V |
3. Once everything is set and ready, power the Sabertooth board and plug in the Propeller Plug.
$ perl -e "print chr(127)" > /dev/ttyUSB0 && perl -e "print chr(255)" > /dev/ttyUSB0Have fun!
$ sleep 3
$ perl -e "print chr(0)" > /dev/ttyUSB0
UPDATE: you can connect PS3 joystick and send signals from it to the Sabertooth. The following code snippet shows a simple example:
When you press UP, DOWN, RIGHT or LEFT the specified command will be sent to the Sabertooth, in this case full forward, full reverse, full forward for the right motor and full forward for the left motor respectively.
No comments:
Post a Comment