RC Car Type-Thing

Hello, all,

I'm building a robot with both Raspberry Pi and an Arduino UNO R3- the Pi for the AI and the Arduino for motion/motion control. I recently bought a joystick for motion control, and that hasn't worked out too well.

Specifics: I've got 4 microservos that I hacked to make continuous. They are arranged on the base as you would expect; two on each side. There is nothing to change the position of the servos themselves (meaning the body of the servo is stationary). What I have been trying to do with the joystick is make it so that when it's pushed forward all servos turn forward, pushed back all servos turn backward, and pushed to the side two wheels on the same side move forward the other two move backward (depending on the direction of course. What I've tried are if/else statements with the values of each of the axes, and since I'm here, that obviously didn't work out too well. The joystick is one of the black PS2 joysticks you can see whenever you go to buy one with pins for ground, 5v, X, Y and the button (I'm not concerned about the button.

Thank you for any help!

You need to post your code if you expect to get help. Post your program using the code button </> so it looks like this

My guess is that you need to separate the business of reading the joystick from the business of controlling the motors. That way you can manage the logic of the system more easily.

Have a look at planning and implementing a program

…R

Robin2:
You need to post your code if you expect to get help. Post your program using the code button </> so it looks like this

My guess is that you need to separate the business of reading the joystick from the business of controlling the motors. That way you can manage the logic of the system more easily.

Have a look at planning and implementing a program

…R

Ah, I figured I might have to do that but thought I might be able to get away with not doing it… Will do soon; the code is on my other computer.