View unanswered posts | View active topics It is currently Wed Sep 19, 2018 6:42 am






Reply to topic  [ 5 posts ] 
RobotC v4.x Joystick problems 
Author Message
Rookie

Joined: Tue Jan 14, 2014 10:00 pm
Posts: 5
Post RobotC v4.x Joystick problems
We're having trouble getting the robot to respond to joystick commands

We checked everything else, motors work fine and respond to direct commands
This also shows that the computer is linked to the robot correctly and all wiring is fine
We pulled up the joystick display on the computer and it showed the joystick sending to
the laptop so that's not the problem.

We narrowed down the problem to either JoystickDriver.c being out of date somehow, or
some weird software/hardware glitch it's not telling me about.

We can't find JoystickDriver.c for download for RobotC 4.x

Any halp out there?


Wed Oct 01, 2014 3:18 pm
Profile
Professor
User avatar

Joined: Sat Aug 31, 2013 9:15 am
Posts: 256
Post Re: RobotC v4.x Joystick problems
Are you using one of the Joystick debugger windows while running your code? They can be found under the LEGO Brick menu in ROBOTC 4.x. Or are you running it using the FCS?

_________________
FTC Team 6100 Chariots of Fire - Programmer (2012-2013)
FTC Team 7468 Blue Chariots of Fire - Programmer (2013-2014)
FTC Team 7468 Blue Chariots of Fire - Mentor (2014-2015)
Check out our team website at http://bluechariotsoffire.com/.


Wed Oct 01, 2014 7:52 pm
Profile
Rookie

Joined: Tue Jan 14, 2014 10:00 pm
Posts: 5
Post Re: RobotC v4.x Joystick problems
We're running the compition joystick window


Wed Oct 08, 2014 2:24 pm
Profile
Rookie

Joined: Tue Jan 14, 2014 10:00 pm
Posts: 5
Post Re: RobotC v4.x Joystick problems
Here's our code for the program, the same as we've used past many years


Code:
#pragma config(Hubs,  S1, HTMotor,  HTMotor,  none,     none)
#pragma config(Sensor, S1,     ,               sensorI2CMuxController)
#pragma config(Motor,  mtr_S1_C1_1,     frontLeft,     tmotorTetrix, openLoop, reversed, driveLeft)
#pragma config(Motor,  mtr_S1_C1_2,     backLeft,      tmotorTetrix, openLoop, reversed, driveLeft)
#pragma config(Motor,  mtr_S1_C2_1,     frontRight,    tmotorTetrix, openLoop, driveRight)
#pragma config(Motor,  mtr_S1_C2_2,     backRight,     tmotorTetrix, openLoop, driveRight)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

// #include "JoystickDriver.c"

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

      //motor[frontLeft] = 0;

      int left = joystick.joy1_y1;
      int right = joystick.joy1_y2;

      motor[frontLeft] = left;
      motor[backLeft] = left;
      motor[frontRight] = right;
      motor[backRight] = right;

      nxtDisplayTextLine(1, "Left=%d", left);
      nxtDisplayTextLine(2, "Left=%d", right);

      wait1Msec(50);

      if (joy1Btn(1) == 1) {
         motor[frontLeft] = 100;
      }
      //int var = joystick.joy1_y1;
   }
}


Wed Oct 08, 2014 2:29 pm
Profile
Professor
User avatar

Joined: Sat Aug 31, 2013 9:15 am
Posts: 256
Post Re: RobotC v4.x Joystick problems
Does the message count on the NXT screen go up while you're testing it? That makes a difference in whether the messages are being received but the data isn't being brought out of them, or whether the messages just aren't making it to the NXT in the first place.

_________________
FTC Team 6100 Chariots of Fire - Programmer (2012-2013)
FTC Team 7468 Blue Chariots of Fire - Programmer (2013-2014)
FTC Team 7468 Blue Chariots of Fire - Mentor (2014-2015)
Check out our team website at http://bluechariotsoffire.com/.


Wed Oct 08, 2014 4:22 pm
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.