Pages: [1]   Go Down
Author Topic: Sabertooth motor control - tank styled Please help young engineers!  (Read 472 times)
0 Members and 1 Guest are viewing this topic.
Maryland
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Mechanical engineering
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I was wondering if someone could help me design a program that can run 2 different dc motor with a sabertooth controller (i have one, and have been using it for segways and stuff) The problem is i don't know how to write a standard like motor1 run until delay and motor 2 run until delay, type with the sabertooth. Also for the motors speed to be controlled with a potentiometer. So basically the motors have button inputs for left and right steering, and then for forward (straight ) control where both motors are running in the same direction, and a potentiometer would control the speed for that.

example  if (button 1 = on) {
motor1 - forward
delay (1000);
}
example if (button 2 = on) {
motor2 -forward
delay(1000);
}

for steering and

potentiometer would control the speed.

so if val = i < 0 {
val = motor1 - forward
val = motor2 -forward
} until u moved the potentiometer to 0 again.

this obviously isn't real code but i just wrote this to explain the type of function im talking about.

and also it would be cool if we could use the potentiometer for steering as well.
Thanks to anyone that wants to help!
Logged

0
Offline Offline
Tesla Member
***
Karma: 114
Posts: 8908
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you have the sabertooth that can be controlled using servo (RC) control signals, then the coding should be doable for using a joystick with two internal pots. I think there is arduino example code in the IDE for using pots with servos.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Maryland
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Mechanical engineering
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks
Logged

Pages: [1]   Go Up
Jump to: