PDA

View Full Version : Joystick and arduino.



duocore
12-31-2009, 09:32 PM
Hello people!
I new in robotic world!
I bought an arduino Duemilanove and made some exercice.
So, now, I want to learm more, but I dont know how...

I want to do something like this:
http://principialabs.com/joystick-control-of-a-servo/

What Im want is exactly what the video show.
When I move left joystick (usb) , the signal pass to computer, computer pass signals for arduino
and arduino pass signal to a servo and servo move to the left. Same when I will move joystick
to the right.

BUT, I dont know how can I do that, where I begin?
I want to use C.

Really thanks!

Adrenalynn
12-31-2009, 11:34 PM
You'd read the joystick on the computer using DirectX/DirectInput (if it's Windows).

You'd translate that into a range for the servo, then send that out to the Arduino. The Arduino would have an application running that would turn that into PWM using the servo library.

Have you considered maybe doing a google search? I mean, just searching something like "read joystick in c" returns links like this: http://mypage.direct.ca/b/bsimpson/joy.c

duocore
01-01-2010, 07:14 AM
Hello!
Thanks for help!
Belive me, I search in google a lot, but not like this your phrase...how can you think I found this site/forum? :veryhappy:

My problem is understand how can I make communication with joystick via USB.
I have some skill with Java, Visual Basic, C# and C. But I never program to communicated an hardware. But will be fun!
I will now search more in google "read joystick in c" :wink:

Really thanks for your help!
But, I will come back!

Thanks!

JonHylands
01-01-2010, 12:12 PM
You can also get a PS-2 type joystick (wired or wireless), and have it talk directly to the Arduino. My friend has a wireless one he got from Lynxmotion (including the plug in adapter), and it works great.

- Jon

duocore
01-01-2010, 05:43 PM
Thanks your reply Jon!
But, I want to know how conect usb joystick talked to pc and after talked with arduino because I want to control a robot on pc, but the "orders" to my robotic walk, turn and more else, via wirelles.:veryhappy: