View unanswered posts | View active topics It is currently Thu Sep 18, 2014 9:56 am






Reply to topic  [ 5 posts ] 
Rookie Team in need of help 
Author Message
Rookie

Joined: Thu Feb 20, 2014 11:23 pm
Posts: 2
Post Rookie Team in need of help
Code was working but now it is not. Cannot get the errors window back. (x-ed out to get it out of the way, cant get it back)

Robot set up- NXT-A-spinning attachment, NXT B & C- Drive motors, TETRIX D and E connected to S1- arm and spinning attachment.

Our Code

#pragma config(Motor, mtr_S1_C2_1, , tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S1_C2_2, , tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S4_C1_1, motorD, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S4_C1_2, motorE, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S4_C2_1, motorF, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S4_C2_2, motorG, tmotorTetrix, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//


task main()

{
while(true)
{
getJoystickSettings(joystick); // Update Buttons and Joysticks
**Error**:Undefined procedure 'getJoystickSettings'.
**Error**:Undefined variable 'joystick'. 'short' assumed.

if(joy1Btn(0) == 1) // If Joy1-Button1 is pressed:
**Error**:Undefined procedure 'joy1Btn'.
{
motor[motorE] = 100; // Turn Motor E On at full power
}
else // If Joy1-Button1 is NOT pressed:
{
motor[motorE] = 0;
}
if(joy1Btn(3) == 1)
{
motor[motorD] = -75;
}
else
{
motor[motorD] = 0;
}
if(joy1Btn(4) == 1)
{
motor[motorA] = 100;
}
else
{
motor[motorA] = 0;
{
motor[motorB] = joystick.joy1_y1;
**Error**:'joystick' is not a reference to a 'struct'
**Error**:Expected->';'. Found 'joy1_y1'
*Warning*:Meaningless statement -- no code generated
motor[motorC] = joystick.joy1_y2;
**Error**:'joystick' is not a reference to a 'struct'
**Error**:Expected->';'. Found 'joy1_y2'
*Warning*:Meaningless statement -- no code generated
}
}
}
}

Any help is appreciated, not sure what some of these errors mean or how to fix them


Thu Feb 20, 2014 11:31 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Rookie Team in need of help
Where is your line that includes the joystick driver?
Code:
#include "JoystickDriver.c"


Fri Feb 21, 2014 4:29 am
Profile
Rookie

Joined: Thu Feb 20, 2014 11:23 pm
Posts: 2
Post Re: Rookie Team in need of help
Thanks for that. It is included now between the #pragma lines and taskmain()

Still having the same errors though


Fri Feb 21, 2014 10:38 am
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Rookie Team in need of help
SystemOverload wrote:
Thanks for that. It is included now between the #pragma lines and taskmain()

Still having the same errors though

If you included JoystickDriver.c, that should get rid of all the joystick related errors. Would you post all the error messages you get now? Are you sure all the messages are the same as before? If the joystick errors are not gone, the only explanation I have is that RobotC couldn't find JoystickDriver.c, in which case you should have another new message saying fail to include JoystickDriver.c. In that case, there is either a typo in the include line or the include path in the Configuration is wrong.


Fri Feb 21, 2014 3:16 pm
Profile
Rookie

Joined: Fri Feb 21, 2014 5:16 pm
Posts: 8
Post Re: Rookie Team in need of help
Try this. There was a problem in the #pragmas and a reversed bracket. I fixed them and threw in some indentation for good measure. To get the error window back, just get rid of a semi-colon somewhere and try to compile the program.


Attachments:
Revised code.c [1.15 KiB]
Downloaded 78 times

_________________
Vincent Bensch FTC #6806 Ratchet Robotics
Fri Feb 21, 2014 7:29 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.