servoVal3 = map(servoVal3, 0, 1023,1000, 1750); // scale it to use it with the servo (result between 0 and 180)servoVal4 = map(servoVal4, 0, 1023, 1250, 1750); // scale it to use it with the servo (result between 70 and 180).....servoVal1 = map(servoVal1, 0, 1023,1000, 1750); // scale it to use it with the servo (result between 0 and 180)servoVal2 = map(servoVal2, 0, 1023, 1250, 1750); // scale it to use it with the servo (result between 70 and 180)

Don't you want to get values between 0 - 90, and 90 - 180? You need to use IF statements like how I have done. If you don't isolate the values, and use them when you need them, you have problems controlling the robot.

i managed to get the 2 motors to make zero point turns, however i now cant get any headway into running at the same time to go forwards and backwards. any ideas/ help would be massively appreciated.

I'd first make two separate pieces of code specific to each pot (forward/reverse pot and turn pot). Get each working to do its specific function, then work on ways to integrate the two working code sections into single code.

Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

This is the problem, I cannot find for the life of me a statement or a string of statements that would allow both Val 3 and Val 4 to equal analogRead(joyV) while keeping the map functions different, is there anything that I am missing? Or would it be better to go with tank controls instead of arcade (I only want to do this if it is impossible), again any help would be readily accepted and deeply appreciated.

servoDrive = analogRead(joyV); servoVal3 = map(servoDrive, 0, 1023,1000, 1750); // scale it to use it with the servo (result between 0 and 180) FORWARD servoVal4 = map(servoDrive, 0, 1023, 1250, 1750); // scale it to use it with the servo (result between 70 and 180) REVERSE

// Read the horizontal joystick value (value between 0 and 1023)

servoTurn = analogRead(joyH); servoVal1 = map(servoTurn, 0, 1023,1000, 1750); // scale it to use it with the servo (result between 0 and 180) LEFT servoVal2 = map(servoTurn, 0, 1023, 1250, 1750); // scale it to use it with the servo (result between 70 and 180) RIGHT

Again, your map values I dont think are correct. "(result between 70 and 180), (result between 0 and 180)"

I don't have any servos or pots setup for testing, but the below (modified knob code) might be a way to loop and trap the pot that leaves the centered position and read it in a sub loop until it returns to the centered position again, at which the main loop is reentered. Hopefully only one non centered pot at a time would be in control of the servos to prevent control conflicts. Not that familiar with looping operations.

servoTurn = analogRead(joyH); servoVal1 = map(servoTurn, 0, 1023,1000, 1750); // scale it to use it with the servo (result between 0 and 180) servoVal2 = map(servoTurn, 0, 1023, 1250, 1750); // scale it to use it with the servo (result between 70 and 180)

// scale it to use it with the servo (result between 0 and 180) servoVal3 = 435 + servoVal4 - servoDrive;

servoVal4 = map(servoDrive, 0, 1023, 1250, 1750);

// scale it to use it with the servo (result between 70 and 180)

myservo2.write(servoVal3); // sets the servo position according to the scaled value myservo1.write(servoVal4);

servoTurn = analogRead(joyH); servoVal1 = map(servoTurn, 0, 1023,1000, 1750); // scale it to use it with the servo (result between 0 and 180) servoVal2 = map(servoTurn, 0, 1023, 1250, 1750); // scale it to use it with the servo (result between 70 and 180)

myservo2.write(servoVal1); // sets the servo position according to the scaled value myservo1.write(servoVal2);

delay(15); // waits for the servo to get there

}

/*** Display joystick values*/void outputJoystick(){

Serial.print(analogRead(joyV)); Serial.print ("----------------"); Serial.print(analogRead(joyH)); Serial.println ("----------------");} for some reason (its one i cant find) whenever the 2 parts of the code are together like then one at the top, all of the code for the Forwards and backwards portion are ignored and the robot cannot move forward. is there anything in the code that makes this Occur? if not does anyone have any advice? as always any help would be appreciated and anyone that has posted so far has been of extreme help.

I'm new to this but I want to achieve something similar but a little less complicated, well in my mind it is . I'm usig a single joystick and 2 motors for an underwater ROV project. Along the y axis its pretty straight foward. stick up both motors full speed fwd, stick down both motors full speed rev and everything in between. Lets call the motors M1 and M2. when i'm refering to the speed of the motors I will just say that full fwd speed is +127, 0 is off and full rev is -127. If that should be different let me know, but for now thats burned into my mind. Ok fwd and rev are cake, turning isn't that hard either. if the joystick is all the way left then m1 is -127 and m2 is +127. if the joystick is half left then m1 is -63 and m2 is +63.

Programming this alone doesn't seem that difficult but when i want to turn while moving forward... joystick all the way to the left and up M1 is 0 and m2 is +127

I have no Idea where to start with this but If it cant happen i can just use two sticks.

I'm new to this but I want to achieve something similar but a little less complicated, well in my mind it is . I'm usig a single joystick and 2 motors for an underwater ROV project. Along the y axis its pretty straight foward. stick up both motors full speed fwd, stick down both motors full speed rev and everything in between. Lets call the motors M1 and M2. when i'm refering to the speed of the motors I will just say that full fwd speed is +127, 0 is off and full rev is -127. If that should be different let me know, but for now thats burned into my mind. Ok fwd and rev are cake, turning isn't that hard either. if the joystick is all the way left then m1 is -127 and m2 is +127. if the joystick is half left then m1 is -63 and m2 is +63.

Programming this alone doesn't seem that difficult but when i want to turn while moving forward... joystick all the way to the left and up M1 is 0 and m2 is +127

I have no Idea where to start with this but If it cant happen i can just use two sticks.

It is possible to do with one stick and this post has a few solutions on it already. But if your still having trouble, post what you have already and we will see what we can do.

I solved this problem a few months ago with the help of a very clever member of the Arduino community...

Quote

One potentiometer controls the left wheel, and the other controls the right. There is currently no reverse, although by remapping the pots to say, -10 to 245 and using an if statement that could easily be handled.

Did you actually provide for reverse?

Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

One potentiometer controls the left wheel, and the other controls the right. There is currently no reverse, although by remapping the pots to say, -10 to 245 and using an if statement that could easily be handled.

Did you actually provide for reverse?

I actually never understood what he was saying in that statement, either - my algorithm, IIRC, as written will automagically handle reverse (I think).

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.