View unanswered posts | View active topics It is currently Fri Aug 22, 2014 11:45 am






Reply to topic  [ 5 posts ] 
joystick troubles... 
Author Message
Rookie

Joined: Tue Jan 29, 2013 5:17 pm
Posts: 5
Post joystick troubles...
Hello all. I am currently trying to control motors with a joystick, but seem to be doing something wrong. I read the RobotC wiki guides, but I suppose I missed something! Here is the code:

Code:

#pragma config(Hubs,  S1, HTMotor,  none,     none,     none)
#pragma config(Sensor, S1,     ,               sensorI2CMuxController)
#pragma config(Motor,  mtr_S1_C1_1,     motor1,        tmotorTetrix, openLoop)
#pragma config(Motor,  mtr_S1_C1_2,     motorE,        tmotorTetrix, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#include "JoystickDriver.c"

task main()
{
while(true)
{
   
getJoystickSettings(joystick);


motor[motor1] = joystick.joy1_x2;
}   

}

Note that, when I simply said motor[motor1] = 100; everything worked as expected. ALSO, I have tried using multiple buttons, and none have worked. :-( Thanks to those who can help me out!


Tue Feb 05, 2013 5:28 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 565
Post Re: joystick troubles...
What appears on the Joystick Debugger window when you moves the joysticks? Do the values change accordingly, or do they not move? Does the joystick appear under the drop down menu, or is it stuck with a 'Joystick Not Found' message?

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Fri Feb 08, 2013 10:26 am
Profile
Rookie

Joined: Tue Jan 29, 2013 5:17 pm
Posts: 5
Post Re: joystick troubles...
Hello Mr Watson! When I move the joysticks, every corresponding button in both the Basic and FTC windows work fine :/ . And yeah, it appears as"Logitech Dual Action"


Tue Mar 12, 2013 4:07 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 565
Post Re: joystick troubles...
If the motor works with a direct assignment such as 'motor[motor1] = 100;' then the issue may be with the joystick drivers themselves. You may want to download the Logitech drivers manually from their site: http://www.logitech.com/en-us/support/g ... =14&bit=64

Also, make sure the switch on the back of the joystick is set to 'D' and not 'X', and that the 'mode' light is turned off (it's the red LED above the left joystick, it can be toggled using the 'mode' button to the left of it).

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Fri Mar 15, 2013 6:30 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: joystick troubles...
JohnWatson wrote:
If the motor works with a direct assignment such as 'motor[motor1] = 100;' then the issue may be with the joystick drivers themselves. You may want to download the Logitech drivers manually from their site: http://www.logitech.com/en-us/support/g ... =14&bit=64

Hmm, my understand is that the game controllers are HID (Human Input Devices). HID compliant devices do not need drivers. Microsoft Windows has built-in drivers to handle standard HID devices. So I am not sure downloading Logitech drivers will help.


Sun Apr 07, 2013 1:07 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.