loading
Components:
1x Arduino Duemilanovue
2x 3.7V Lithium polymer batteries in parallel
2x HiTEC HS-485 servos
1x Playstation 2 style analog joystick
1x yellow LED

Create with the following references:
http://arduino-info.wikispaces.com/Brick-Potentiometer-Joystick
http://www.trossenrobotics.com/store/p/6340-Electronic-Brick-Playstation2-Analog-Joystick.aspx
http://www.arduino.cc/en/Tutorial/JoyStick

For more projects, visit http://retardokiddo.blogspot.com/


<p>can u send me the code and the schematic??</p><p>thanks</p>
<p>can you send me the code</p>
<p>Hi, i wish to thank you for the good work you did. I am a newbie and i am trying to understand if may it be possible to make the servo back to the starting position ( x=0 y=0) with the pression of the joystick button.</p><p>Thanks in advance for your help</p>
having not found it myself, here's some simple i code i wrote for the &quot;move &amp; stay&quot; control... and it includes acceleration as well. not perfect, but it will get you started.<br> <br> --------<br> <br> #include &lt;Servo.h&gt;<br> <br> Servo panServo;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br> Servo tiltServo;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br> <br> int servoPanPosition = 90;<br> int servoTiltPosition = 90;<br> int joystickPanPin = A0;<br> int joystickTiltPin = A1;<br> int joystickPanSpeed = 0;<br> int joystickTiltSpeed = 0;<br> int servoPanPin = 9;<br> int servoTiltPin = 10;<br> <br> <br> void setup()<br> {<br> &nbsp; pinMode(servoPanPin, OUTPUT);<br> &nbsp; pinMode(servoTiltPin, OUTPUT);<br> &nbsp; panServo.attach(servoPanPin);<br> &nbsp; tiltServo.attach(servoTiltPin);<br> }<br> <br> <br> void loop()<br> {<br> &nbsp; joystickPanSpeed = (analogRead(joystickPanPin) - 512) / 50;<br> &nbsp;&nbsp;&nbsp; // -512 to provide equal +/- numbers<br> &nbsp; joystickTiltSpeed = (analogRead(joystickTiltPin) - 512) / -50;<br> &nbsp;&nbsp;&nbsp; // negative 50 to reverse direction<br> <br> &nbsp; servoPanPosition = constrain((servoPanPosition + joystickPanSpeed), 1, 180);<br> &nbsp; servoTiltPosition = constrain((servoTiltPosition + joystickTiltSpeed), 1, 180);<br> &nbsp;&nbsp;&nbsp; // constarin function to not exceed servo limits<br> <br> &nbsp; panServo.write(servoPanPosition);<br> &nbsp; tiltServo.write(servoTiltPosition);<br> <br> &nbsp; delay(50);<br> &nbsp;&nbsp;&nbsp; // adjustable for overall speed<br> }
<p>Thanks a lot. Your code works very flawlessly. I found others trying to do the same thing but they look too complicated and lengthy the code. Your way is short, easy to understand and can easily implemented to use with 3+ joysticks to control 6 servos. Have a nice day, </p>
here's a simple way to connect a joystick (which is just 2 potentiometers) to the arduino... made in fritzing:
I second that motion...why put up a video and not list out how you connected it.
can you post a picture showing how the servos and joystick <br>hook up with the arduino. thanks!
could you upload the sketch? i cant figure out how to get the servos to maintain the last position when the joystick returns to center. this has kicked my butt like no other. THANKS and great build!!!!

About This Instructable

31,313views

55favorites

License:

More by c0ffeepowder:3D Printing - Push Up Bar Add-on! 3D Printing - Table Foot Replacement 3D Printer - Verifying Accuracy of Print 
Add instructable to: