ROBOTC.net forums
http://www.robotc.net/forums/

FTC Joystick Programming
http://www.robotc.net/forums/viewtopic.php?f=52&t=846
Page 1 of 1

Author:  TJH [ Thu Oct 23, 2008 7:06 pm ]
Post subject:  FTC Joystick Programming

:breakcomputer: :breakcomputer: :breakcomputer:

We need help.
We have tried all the sample programs we could find. Trying to edit them to work does nothing.
And no, we did not forget to add #include "JoystickDriver.c" at the top.
We have the Logitech controller hooked up to the USB Port. All its software is installed and ready to go.
All the ports are 2.0.
The computer (a laptop) has Bluetooth.
The laptop is Windows Vista and practically brand new.
Both the NXT and the laptop showed that they were connected.
There are no errors, the controller doesn't appear to be having any affect on the program.
What can we do? We have wracked our brains out for, oh, about an hour or so.
Here is an example of a sample program we tried:

#include "JoystickDriver.c" // This file does all of the processing of the BT Packet
task main()
{
while (true)
{
getJoystickSettings(joystick);
//Check for new BT Packet and update the variables for the joystick positions
if(joy1Btn(1)) //if Button 1 on Joy1 is pressed
{
servo[servo1] = 200; //Move servo #1 to position 200
}
else //if Button 1 on Joy1 is not pressed
{
servo[servo1] = 50; //Move servo #1 to position 50
}
}
}

Author:  CC335 [ Thu Oct 23, 2008 8:46 pm ]
Post subject:  Re: FTC Joystick Programming

It doesn't look like your code is the problem.
Are you running the code in FTC mode?

Author:  Jeff McBride [ Thu Oct 23, 2008 10:04 pm ]
Post subject:  Re: FTC Joystick Programming

I suggest opening the Servos debug window and trying to set the servo to different positions manually. If that doesn't work then you probably have a wiring problem.

Author:  tfriez [ Fri Oct 24, 2008 2:52 pm ]
Post subject:  Re: FTC Joystick Programming

Do you have the ROBOTC Joystick Debugger Window open? It will not send Joystick Messages until you have that window open.

You can find those by download your program, and then going to "Robot - Debug Windows - Joystick" with the debugger window open.

Author:  TJH [ Tue Oct 28, 2008 5:45 pm ]
Post subject:  Re: FTC Joystick Programming

:D Thank you, all of you!
tfriez especially! They were all possibilities and his just happened to work.
I'm glad I contacted you.
Thanks from all of TJH Robotics Club!
Sincerely,
Jakob

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/