Author Options:

Read a Joystick in Processing? Answered

I am making a Bluetooth controlled spy robot. I need to be able to read the joystick to control the robot and the little analog stick to control the pan/tilt system. I am not that fluent in processing, so I don't know if there is a joystick command or do I have to use a library.Thx


Apart from the joystick; what are you building this with?


It is a bluesmirf hooked up to an arduino or a chipKIT running two modified servos the pan and tilt system is two servos.

The joystick is hooked up to processing on my laptop and when it gets data it sends it to my arduino

Ah, now if you'd actually said that in the first place...

Try JavaJoystick.


Not being a Processing expert, I suggest that you look at the documentation for the thing. AIUI, if its in the library path for your project, Processing can use it.


A thought just came to me. What if I use two arduinos, go directly to the pots and have one telling the serial the data, then have the processing code read it and send it to the other via bluetooth.

That's another method - use a serial interface to Processing.