Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef SabertoothSimplified_h
00020 #define SabertoothSimplified_h
00021
00022 #if defined(ARDUINO) && ARDUINO >= 100
00023 #include <Arduino.h>
00024 #else
00025 #include <WProgram.h>
00026 #endif
00027
00028 #if defined(USBCON)
00029 #define SabertoothTXPinSerial Serial1 // Arduino Leonardo has TX->1 on Serial1, not Serial.
00030 #else
00031 #define SabertoothTXPinSerial Serial1
00032 #endif
00033 #define SyRenTXPinSerial SabertoothTXPinSerial
00034
00039 class SabertoothSimplified
00040 {
00041 public:
00046 SabertoothSimplified();
00047
00053 SabertoothSimplified(Print& port);
00054
00055 public:
00060 void motor(int power);
00061
00067 void motor(byte motor, int power);
00068
00073 void drive(int power);
00074
00079 void turn(int power);
00080
00084 void stop();
00085
00086 private:
00087 void mixedMode(boolean enable);
00088 void mixedUpdate();
00089 void raw(byte motor, int power);
00090
00091 private:
00092 boolean _mixed;
00093 int _mixedDrive, _mixedTurn;
00094 boolean _mixedDriveSet, _mixedTurnSet;
00095 Print& _port;
00096 };
00097
00098 #endif