View unanswered posts | View active topics It is currently Thu Oct 23, 2014 12:32 am






Reply to topic  [ 5 posts ] 
Robotc say's my JoystickDriver is already opened 
Author Message
Rookie

Joined: Tue Sep 30, 2014 12:24 pm
Posts: 1
Post Robotc say's my JoystickDriver is already opened
Hi,
So our team just switched from Robotc 3 to Robotc 4, and we want to use a program in Robotc 4 that worked correctly in Robotc 3, but we keep getting an error that reads "JoystickDriver.c has already been opened". When we try to run our program, our robot always gets stuck in this loop (but the loop doesn't seem to be the problem):

if(joystick.joy1_TopHat == 0)
{
driveForward();
}

When running our program, our robot always just drives forward, regardless of the joystick's readout.

Here's the beginning of the code:


#include "JoystickDriver.c"

///////////////////////////////////////////////////////////////

task main()
{
clearDebugStream();

while(true)
{
if(joystick.joy1_TopHat == 0)
{
driveForward();
}
else if(joystick.joy1_TopHat == 2)
{
strafeRight();
}

Any ideas on how to fix it?

Thanks


Tue Sep 30, 2014 12:59 pm
Profile
Expert
User avatar

Joined: Sat Aug 31, 2013 9:15 am
Posts: 137
Post Re: Robotc say's my JoystickDriver is already opened
I see in your loop you're missing getJoystickSettings(joystick). So that certainly is contributing to your issues.

_________________
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://cof7468.weebly.com/.


Wed Oct 01, 2014 12:35 pm
Profile
Expert

Joined: Mon Oct 27, 2008 9:59 pm
Posts: 139
Post Re: Robotc say's my JoystickDriver is already opened
I have a team in my area seeing the same issue.
There is nothing wrong with the code examples they've tried (they have the correct getJoystickSettings() call and the code works fine on my computer; only they seem to be getting the weird info message about JoystickDriver.c already being open.
That implies to me it is something in their installation of ROBOTC or some sort of environment setting. I've attached a screenshot of one of the error from one of the sample programs they were testing.

I've asked them to try doing a clean install of ROBOTC, but any other ideas are welcome!


Attachments:
File comment: Info Message Screenshot
RobotC Warning.PNG
RobotC Warning.PNG [ 298.22 KiB | Viewed 64 times ]
Fri Oct 17, 2014 8:33 am
Profile
Expert

Joined: Mon Oct 27, 2008 9:59 pm
Posts: 139
Post Re: Robotc say's my JoystickDriver is already opened
Looks like the team had Natural Language enabled which does not support the joystick driver.... simply unselecting that appears to have resolved the issue.
FYI to anyone else who runs across this.


Fri Oct 17, 2014 3:12 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 593
Post Re: Robotc say's my JoystickDriver is already opened
l0jec wrote:
Looks like the team had Natural Language enabled which does not support the joystick driver.... simply unselecting that appears to have resolved the issue.
FYI to anyone else who runs across this.


This is partially correct; trying to include the joystickdriver.c file in a Natural Language program will generate a non-critical warning (it won't stop the program from compiling) saying that the joystickdriver.c file has already been included. This is because the joystickdriver.c file is automatically included with a Natural Language file "behind the scenes".

_________________
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 Oct 17, 2014 4:48 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.