Sabertooth Simplified Serial Library for Arduino
Control your Sabertooth with Simplified Serial.
Sweeps from full reverse to full forward and then from full forward to full reverse.
// Sweep Sample
// Copyright (c) 2012 Dimension Engineering LLC
// See license.txt for license details.
SabertoothSimplified ST; // We'll name the Sabertooth object ST.
// For how to configure the Sabertooth, see the DIP Switch Wizard for
// Be sure to select Simplified Serial Mode for use with this library.
// This sample uses a baud rate of 9600.
// Connections to make:
// Arduino TX->1 -> Sabertooth S1
// Arduino GND -> Sabertooth 0V
// Arduino VIN -> Sabertooth 5V (OPTIONAL, if you want the Sabertooth to power the Arduino)
// If you want to use a pin other than TX->1, see the SoftwareSerial example.
SabertoothTXPinSerial.begin(9600); // This is the baud rate you chose with the DIP switches.
// Ramp motor 1 and motor 2 from -127 to 127 (full reverse to full forward),
// waiting 20 ms (1/50th of a second) per value.
for (power = -127; power <= 127; power ++)
// Now go back the way we came.
for (power = 127; power >= -127; power --)