View unanswered posts | View active topics It is currently Tue Sep 16, 2014 4:15 am






Reply to topic  [ 21 posts ]  Go to page Previous  1, 2
Problems with Remote Control 
Author Message
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Problems with Remote Control
Woud you also add this debug code?
Code:
nxtDisplayTextLine(5, "UserMode=%x,StopPgm=%x", joystick.UserMode, joystick.StopPgm);

This will basically show you what RobotC thinks whether you are in Autonomous or TeleOp mode. In other words, it will show if you have selected the correct mode in the FTC game controller dialogue.
Another crazy question: are you using one or two joysticks? If you are using two, did you enable dual joystick in the game controller dialogue? And also make sure you have correctly associated the joysticks.


Thu Jan 05, 2012 3:32 pm
Profile
Rookie

Joined: Tue Jan 03, 2012 2:32 pm
Posts: 10
Post Re: Problems with Remote Control
I will add that when I get a chance and let you know.

I had hoped to just get 1 joystick working before working with 2 at a time.


Thu Jan 05, 2012 3:54 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Problems with Remote Control
scottd wrote:
I had hoped to just get 1 joystick working before working with 2 at a time.

If you are using 1 joystick, make sure only one is plugged into your laptop. This will eliminate the possibility of wrong joystick association.


Thu Jan 05, 2012 4:00 pm
Profile
Rookie

Joined: Tue Jan 03, 2012 2:32 pm
Posts: 10
Post Re: Problems with Remote Control
Yep, we are only using one and I don't think we've ever had both plugged in at the same time.


Thu Jan 05, 2012 4:07 pm
Profile
Expert

Joined: Mon Oct 27, 2008 9:59 pm
Posts: 137
Post Re: Problems with Remote Control
Here's some more test code; this one does nothing but display the joystick state as seen by the NXT:

Code:
#include "JoystickDriver.c";

task main
{
  bDisplayDiagnostics = false;

  while(true)
  {
     getJoystickSettings(joystick);

     //display joystick state
     //analog sticks
     nxtDisplayTextLine(0, "x1:%4d, y1:%4d", joystick.joy1_x1, joystick.joy1_y1);
     nxtDisplayTextLine(1, "x2:%4d, y2:%4d", joystick.joy1_x2, joystick.joy1_y2);
     //buttons
     nxtDisplayTextLine(2, "%2s %2s %2s %2s", joy1Btn(1) ? "1" : "", joy1Btn(2) ? "2" : "", joy1Btn(3) ? "3" : "", joy1Btn(4) ? "4" : "");
     nxtDisplayTextLine(3, "%2s %2s %2s %2s", joy1Btn(5) ? "5" : "", joy1Btn(6) ? "6" : "", joy1Btn(7) ? "7" : "", joy1Btn(8) ? "8" : "");
     nxtDisplayTextLine(4, "%2s %2s %2s %2s", joy1Btn(9) ? "9" : "", joy1Btn(10) ? "10" : "", joy1Btn(11) ? "11" : "", joy1Btn(12) ? "12" : "");
     //tophat
     nxtDisplayTextLine(5, "Tophat: %d", joystick.joy1_TopHat);
     //mode info
     nxtDisplayTextLine(6, "%s", joystick.UserMode ? "Tele-Op" : "Autonmous");
     nxtDisplayTextLine(7, "%s", joystick.StopPgm ? "Stopped" : "Started");
  }

}


Thu Jan 05, 2012 11:21 pm
Profile
Rookie

Joined: Tue Jan 03, 2012 2:32 pm
Posts: 10
Post Re: Problems with Remote Control
It's working now. It ended up being some strange combination of RobotC 2 and 3 files. Of course the joystickdriver.c file was one of those that was messed up.

Thanks to everyone that offered help. Especially l0jec who spent 1.5 hours on the phone with me tonight going through all kinds of tests. I learned a lot about the robot itself and how the competitions work. I am now looking forward to our first competition and letting the kids know the robot is working.

Thanks again.
Scott


Fri Jan 06, 2012 1:12 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 21 posts ]  Go to page Previous  1, 2

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.