Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   p2 not working? (http://www.chiefdelphi.com/forums/showthread.php?t=64530)

Lone_Wolf92c 18-02-2008 23:48

p2 not working?
 
We've set our robot to use a single joystick drive, planning to use a seperate joystick (manned by a second operator) to operate our claw/arm/etc... The problem is that the robot doesn't seem to be getting feed from the second joystick.

Do we need to initialize this second joystick somehow, because I don't remember initializing the first one to begin with. (The terminal window that opens after using the IFI Loader only shows the inputs from p1_y, p1_x, p1_trig, and p1_top)

SL8 19-02-2008 00:14

Re: p2 not working?
 
Could you include your code and your controller configuration? I could not really help otherwise.

SL8 19-02-2008 00:16

Re: p2 not working?
 
also, are you using easyC or Mplab

jgannon 19-02-2008 03:11

Re: p2 not working?
 
The printout in the terminal is only an example. The values for the second joystick are available in the variables that you might expect (p2_x, p2_y, etc.). You just don't happen to be printing them out.

jasonpeinko 19-02-2008 09:48

Re: p2 not working?
 
i think your triggers need to p1_sw_trig

gnormhurst 22-02-2008 08:49

Re: p2 not working?
 
That's correct: you don't need to init the joysticks. Yes, the port 2 values are accessed just like port 1 except using "p2_" instead of "p1_".

Is the second joystick broken? Plug it into port 1 to see if it will work like the other joystick.

If you can add printf's to print the p2_ values, that should help you figure things out.

If you're still stuck, post more info and code...


All times are GMT -5. The time now is 12:31.

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