I'm wanting to be able to control two 36v motor with a joystick. Need to go straight when pointed up, backwards when down Left when pointed left and the same for right. Have not found any past project do this for guidance.
Help would be appreciated
I think you can buy joystick switches that do that. No need for an Arduino. Check out electric wheelchair suppliers.
Post the model of joystick, batteries and the motor drivers you’re hoping to use.
With those, we can start thinking about the bits in the middle.
I did a forum search at the upper left on part of the subject line and got a page of hits.
int speedInput = analogRead(YPotPin); // Forward/Reverse
int yawInput = analogRead(XPotPin); // Left/Right turn
// This is a crude mapping.
speedInput = map(speedInput, 0, 1023, -255, 255);
yawInput = map(yawInput, 0, 1023, -255, 255);
// Put in dead zones
if (speedInput > -10 && speedInput < 10)
speedInput = 0;
if (yawInput > -10 && yawInput < 10)
yawInput = 0;
int leftSpeed = speedInput + (YAW_SENSITIVITY * yawInput);
int rightSpeed = speedInput - (YAW_SENSITIVITY * yawInput);
// neither motor can go faster than maximum speed
leftSpeed = constrain(leftSpeed, -256, 256);
rightSpeed = constrain(rightSpeed, -256, 256);
// For positive speeds, motor goes forward at speed
// For negative speeds, motor goes backward at -speed
// For zero speeds, turn off motor
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.