Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Joystick Hat button (http://www.chiefdelphi.com/forums/showthread.php?t=34966)

ten3brousone 19-02-2005 11:16

Joystick Hat button
 
a quick question. for the joystick hat button on top theres 4 ways you can push it. any idea what values the bot recieves when you go forward, left, down, right, on the hat button? 1, 2, 3, 4? or are they each a diff variable. thanks for help

phillutz 19-02-2005 11:22

Re: Joystick Hat button
 
we coded to test that out last year. Sorry just can't remember the values.
By using your dashboard or printf statments you should be able to display all the joystick values.

Phil

ten3brousone 19-02-2005 11:24

Re: Joystick Hat button
 
haha would love to but we cant find our dashboard cable ^.^ our teams not very clean haha

ConKbot of Doom 19-02-2005 15:45

Re: Joystick Hat button
 
Then just use printf statements like phillutz said. Edit one of the variables in the printf statement at the end of DefaultRoutine() so that is pX_wheel (X is the port number it is on)


You should see the numbers scrolling by in the terminal window after you load the program.

steven114 19-02-2005 17:38

Re: Joystick Hat button
 
The dashboard uses a standard serial cable. There is no specialized 'dashboard' cable.

Adam Shapiro 19-02-2005 18:32

Re: Joystick Hat button
 
The POV hat is not wired by default. In order to use it you will have to open the joystick, disassemble the controls, test for continuity to find the POV pins, and rewire it appropriately. I just did ours today, it doesn't take very long to do (so long as you are ok at soldering). Sorry I don't have any pictures to send you, I will open the stick again if I have the time tonight.

f00fc7c8 20-02-2005 13:13

Re: Joystick Hat button
 
Quote:

Originally Posted by ten3brousone
a quick question. for the joystick hat button on top theres 4 ways you can push it. any idea what values the bot recieves when you go forward, left, down, right, on the hat button? 1, 2, 3, 4? or are they each a diff variable. thanks for help

I tested this out the other day using the IFI Dashboard. The POV hatswitch IS wired by default, and you can read it in the variable pFOO_wheel, where FOO is the port number to which your joystick is connected.

I'm afraid I don't remember the precise values, though. Sorry.

Anton 20-02-2005 13:22

Re: Joystick Hat button
 
it's a variable called"pFOO_aux",where FOO is the port number to which your joystick is connected.just make a printf for it(i would have checked it myself but I don't use these joysticks).
every time you want to acess a variable and you don;t know how, go to "ifialiases.h". practically everything can be found there

JamesBrown 20-02-2005 13:31

Re: Joystick Hat button
 
The hat sends a pwm value
Neutral= 45
forward= 254
left = 97
down/left= 163
down= 136'=
down/right= 213
right= 203

Hope that hleps
James


All times are GMT -5. The time now is 17:54.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi