Go Down

Topic: Joystick (9 inputs) (Read 759 times) previous topic - next topic

nate890

Hello, I'm fairly new to Arduino and this is one of the more complex things that I've come across... It's a joystick that used 9 jumper cables.

I was wondering if anyone knows where to hook what to or if anyone knows of any tutorials.

Here's what I'm dealing with (Brown represents black):

nate890

I've already looked for tutorials, but I was unable to find a tutorial for a 9 input joystick.

Far-seeker

Ok, first question...  Do you actually have this joystick, or is it something you found on-line?

nate890

That's an actual picture.

Far-seeker

Ok, the reason why I'm asking is if you physically have the hardware you may not need the libraries to use it, though they'd be much more convenient.  I'm assuming however you acquired it datasheets were not available, so if you can locate any part numbers on either the board or the joystick try searching for datasheets and libraries. 

In the worst case you have the option of trial-and-error testing to figure-out the output of all the different signal lines at any given position of the joystick (I'd start with the cardinal directions; up, down, right, left, then the diagonals).  You can also determine if it has a button-like feature when you put a little pressure on it (which unlike the probably analog position outputs would be an on/off momentary switch).  All of this can be done with just a digital multimeter set to measure voltage, but you'll only be able to measure one signal wire at a time. 

nate890

The joystick had a website on it, and I found the exact joystick by going to the website (http://www.dfrobot.com/index.php?route=product/product&filter_name=joystick&product_id=349), yes, I can press down on the joystick and there is a click. It just came with the joystick and 3 "sensor cables".

Something I really don't want to do is trial and error. I have no idea where what goes or where what might need to go. I'm also not wanting to blow anything.

dxw00d

Did you read http://www.dfrobot.com/wiki/index.php?title=Joystick_Module_For_Arduino_%28SKU:DFR0061%29 ?

nate890

Yes, I have, "This joystick module can be easily connect to Arduino by IO Expansion Shield For Arduino(V5) (SKU: DFR0088) with supplied cables." I don't have a shield for this kind of stuff. I'm trying to get it to work with just the module, a breadboard, the joystick, the cables it came with (along with 9 jumper cables) and an Arduino UNO.

dxw00d

That's ok then. The sketch tells you how to connect it up.

Code: [Select]
// #        X-Axis  -> Analog pin 0
// #        Y-Axis  -> Analog pin 1
// #        Z-Axis  -> Digital pin 3

nate890

But what 3 cables are those, and where do the other 6 go.

dxw00d

There are labels on the circuit board. The S pins are the X and Y axis analogue outputs. The D pin is the Z axis digital output. The VCC pins go to the Arduino 5V pin. The GND pins go to the Arduino ground.

Far-seeker

As dxw00d, posted they do provide a bit more information on their wiki.  Besides that, just with the close-up images on the dfrobot site it seems that only 3 of the wires are for output signals (the middle wire on each three position connector).  The rest are seperate grounds and power wires for each axis, so you should be able to connect all three grounds together on your breadboard, and likewise all three VCC/power pins.  Z-axis will be the push button, with X and Y axes being the joystick position.  Just configure the pins you use for X and Y as analog inputs, and you can use them like any other resistance based X-Y joystick or thumbstick.  Keep the Z-axis as a digital input and it will work like any push button.

nate890


Far-seeker


Go Up