Robotic Arm Joystick Programming

Hey everyone i was making a robotic arm help me if my code is correct.

And the parts i am using are correct.

UNO REV 3
SG 90 servo*4
Duinotech *2 joystick
Breadboard to connect all servos in parallel for external power. and breadboard’s gnd to uno’s gnd. Also can i merge both joystick’s vcc and gnd into one… vcc to vcc and gnd to gnd and then connect connect the common gnd and vcc to arduino’s vcc and gnd. Will it work

If you have a read at the code you will see where i attached everything.

Joystick- Arduino Compatible X and Y Axis Joystick Module | Jaycar Electronics

Robotic_arm_with_joystick.ino (971 Bytes)

sorry two things mis wrote in code are(new values written down for define joystick 2 x and y)

int joyX2 =2; int joyY2 =3;

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks… Tom… :slight_smile:

As TomGeorge points out, read the ‘how to use this forum - please read’ post. Post your code rather than attach it.

If you have a read at the code you will see where i attached everything.

Not good enough. Post a wiring diagram. (Also as TomGeorge requests). Pencil, paper and a camera are good enough if you provide proper detail like pin numbers.

help me if my code is correct.

Easy enough to determine. Wire everything up, upload the sketch and see if it works. Although I would prefer a more ‘step by step’ approach. Is this the first time you have used an arduino?
First try the blink tutorial. No wiring needed and this lets you know that you can successfully upload a sketch.
Then try a servo sweep tutorial to confirm you can wire up servos successfully.
Then a Joystick tutorial.

Breadboard to connect all servos in parallel for external power

I re-read your original post and thought I would comment on this. Using a breadboard to power servos will work for tests with unloaded servos - servos with nothing attached to the output arms. But if the servos are connected to something they actually have to work at to move, the breadboard will not be able to provide the current that multiple servos will demand, and may burn out a trace.

Use a breadboard for testing unloaded servos. Use better power connections for actually moving things with servos.