View unanswered posts | View active topics It is currently Thu Aug 21, 2014 2:44 am






Reply to topic  [ 8 posts ] 
Wait For Start Command 
Author Message
Rookie

Joined: Tue Oct 15, 2013 9:44 pm
Posts: 8
Post Wait For Start Command
We tried to compile our autonomous programs, but robotC gives us an error saying undefined procedure. The problem is with the "waitForStart();" command. We type it exactly like that and doesn't work. Any ideas of what the problem is?


Tue Dec 10, 2013 2:11 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 564
Post Re: Wait For Start Command
Can you post your code using the [code] tags? This will help us determine what the root cause of this issue is.

There are a couple common causes of this issue that you can check in the meantime. First, check to make sure that your Platform Type (under the Robot menu) in ROBOTC is set to LEGO NXT + TETRIX/MATRIX and not just LEGO MINDSTORMS NXT.

Next, check to make sure that the 'Compiler Target' (also under the Robot menu) is set to 'Physical Robot' and not 'PC-Based Emulator' (if applicable).

Please let us know if either of these solve the issue for you, and if not, please make sure to post your code (using the [code] tags) and we will be more than happy to assist you further.

_________________
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


Tue Dec 10, 2013 2:43 pm
Profile
Rookie

Joined: Tue Oct 15, 2013 9:44 pm
Posts: 8
Post Re: Wait For Start Command
What do you mean "code tags"? And yes, all the other settings are correct as you stated.


Tue Dec 10, 2013 4:12 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Wait For Start Command
When you reply the post, there is a "button" that says "Code". If you click that it will generate a code tag in your reply. If you put your code in between these code tags, the indentation will be preserved.


Tue Dec 10, 2013 4:17 pm
Profile
Rookie

Joined: Tue Oct 15, 2013 9:44 pm
Posts: 8
Post Re: Wait For Start Command
Thank you, I will post my code before 5 today.


Tue Dec 10, 2013 4:35 pm
Profile
Rookie

Joined: Tue Oct 15, 2013 9:44 pm
Posts: 8
Post Re: Wait For Start Command
Here is the code. (Above the const int's is the motor and sensor setup code)

Code:
const int servostart = 35;
const int servoend = 235;

void initializeRobot()
{
   return;
}

task main()
{
   initializeRobot();
   waitForStart();

   servo(auto) = servostart;
   ClearTimer(T1);

   while(true)
   {
      motor[leftmotor] = 50;
      motor[rightmotor] = 50;
      wait10Msec(300);
      servo[auto] = servoend;
      servo[auto] = servostart
   }
}


Tue Dec 10, 2013 6:12 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Wait For Start Command
The waitForStart() function is defined in JoystickDriver.c. So you need to include it. Please put the following line at the top of your program but underneath the pragmas.
Code:
#include "JoystickDriver.c"


Tue Dec 10, 2013 6:50 pm
Profile
Rookie

Joined: Tue Oct 15, 2013 9:44 pm
Posts: 8
Post Re: Wait For Start Command
Thank You so much!!!
This works perfectly now.


Tue Dec 10, 2013 9:21 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 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.