1. You must be a registered member to be able to access this page and to download game plugins. Please register here. It´s for free.
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules
Wanegain

Arduino + Sabertooth 2x32 up to 6 motors 1.8

Arduino sketch for Arduino and up to 3 Sabertooth 2x32 (6 motors)

  1. Wanegain
    A new version of my previous sketch !

    Now you are able to drive up to 6 motors with only one Arduino (be careful you need at least 7 analog inputs for 6 motors) and you can use serial monitor to talk with your Arduino.
    • First thing do to after extracting : copy the folder Sabertooth in Documents\Arduino\libraries
    • You can notice the config.h file : THIS IS THE ONLY FILE YOU NEED TO EDIT and it must be in the same directory than the ino file.
    Let's look at this file before uploading to Arduino :
    1. Define numbers of motors you will use (4 default)
    2. Deadzone : global deazone (5 default)
    3. Read Analog : Arduino will read "Read Analog" times values of potentiometers to reduce noise (4 is default)
    4. Pin standby : pin where you can add a switch (connected to ground on other side) to force all motors to move in a standby position (defined in parameters for motors)
    5. Pin power and Use pot : you can use a potentiometer for global power (0 to 200%) and specify a pin. To enable this option you need to set Use pot = 1 and of course the pin used by the potentiometer.
    6. Speed pos is the maximum speed when Start/stop commands are received (30 default ~ 25%)
    7. For each motors you can set different options : pot min, pot max, deadzone, standby value (used too when idle) and P.I.D values.
    IMPORTANT NOTE : this sketch has been written for an Arduino Micro, if you are using another model, please be sure all pin exists (even you will not use it) otherwise you will probably have an error message when compiling.
    If you are using less than 6 motors, you can set all unused pins for potentiometers with same value (A4 for example)

    As I said, you can talk with your Arduino using serial monitor :
    Just type :
    XV00C : to know the current version of sketch
    XC00C : to see the global parameters (read analog, deadzone, speed post, etc...)
    XM00C : to see all parameters for all motors
    XP00C : to see real time values of potentiometers (retype XP00C to stop it)

    Simtools configuration :
    Serial 57600 bauds 8N1 10bits BINARY
    Start : XS00C 5ms
    Interface : X1<Axis1a>CX2<Axis2a>CX3<Axis3a>CX4<Axis4a>CX5<Axis5a>CX6<Axis6a>C 5ms
    Stop : XE00C 5ms

    Connections:
    Sabertooth 1 S1 : pin 2
    Sabertooth 2 S1 : pin 3
    Sabertooth 3 S1 : pin 4

    for potentiometers and switch see config.h file :)
    RacingMat likes this.

Recent Reviews

  1. Foxyfoxy
    Foxyfoxy
    5/5,
    Version: 1.8
    How could we do without this code
    Great work
    BRAVO à toi