|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Declaring Second Joystick
I have had issues attempting to make certain code only apply to the joystick in port 2, however it merely puts all the code into the first joystick. Any suggestions would be great!
|
|
#2
|
|||
|
|||
|
Re: Declaring Second Joystick
Basically how do we declare a second joystick in C++.
|
|
#3
|
||||
|
||||
|
Re: Declaring Second Joystick
Code:
class MyRobot: public SimpleRobot
{
Joystick stick1;
Joystick stick2;
MyRobot(): stick1(1),
stick2(2)
{
}
...
void OperatorControl()
{
if (stick1.GetRawButton(1))
{
}
else if (stick2.GetRawButton(1))
{
}
}
};
Last edited by mikets : 10-02-2012 at 16:04. |
|
#4
|
|||
|
|||
|
Re: Declaring Second Joystick
Yeah, different numbers should be assigned to the joysticks.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|