Pages: [1]   Go Down
Author Topic: Joystick (9 inputs)  (Read 698 times)
0 Members and 1 Guest are viewing this topic.
Brampton, Ontario
Offline Offline
Full Member
***
Karma: 0
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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):


* 120723-144024.jpg (458.91 KB, 1280x1024 - viewed 14 times.)
Logged

Brampton, Ontario
Offline Offline
Full Member
***
Karma: 0
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Brampton, Ontario
Offline Offline
Full Member
***
Karma: 0
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's an actual picture.
Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. 
Logged

Brampton, Ontario
Offline Offline
Full Member
***
Karma: 0
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Brampton, Ontario
Offline Offline
Full Member
***
Karma: 0
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Brampton, Ontario
Offline Offline
Full Member
***
Karma: 0
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Brampton, Ontario
Offline Offline
Full Member
***
Karma: 0
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks dude!
Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You're welcome.
Logged

Pages: [1]   Go Up
Jump to: