View unanswered posts | View active topics It is currently Fri Nov 22, 2019 10:57 am






Reply to topic  [ 2 posts ] 
ROBOTC LEGO EV3 **Error**: Undefined procedure 'waitUntil' 
Author Message
Rookie

Joined: Fri Mar 27, 2015 11:02 am
Posts: 1
Post ROBOTC LEGO EV3 **Error**: Undefined procedure 'waitUntil'
Hi everyone,
I don't know what the problem is..
Code:
#pragma config(Sensor, S1,     ColorRight,     sensorEV3_Color, modeEV3Color_Color)
#pragma config(Sensor, S2,     ColorLeft,      sensorEV3_Color, modeEV3Color_Color)
#pragma config(Sensor, S3,     ColorCenter,    sensorEV3_Color, modeEV3Color_Color)
#pragma config(Sensor, S4,     Ultrasonic,     sensorEV3_Ultrasonic)
#pragma config(Motor,  motorA,          MotorRight,    tmotorEV3_Large, PIDControl, driveRight, encoder)
#pragma config(Motor,  motorB,          MotorLeft,     tmotorEV3_Large, PIDControl, driveLeft, encoder)
#pragma config(Motor,  motorC,          MotorCenter,   tmotorEV3_Medium, PIDControl, encoder)
#pragma config(Motor,  motorD,           ,             tmotorEV3_Large, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task SensorRight()
{
   repeat(forever)
   {
      switch (ColorRight)
      {
      case colorGreen:
         hogCPU();
         resetMotorEncoder(MotorLeft);
         setMotorTarget(MotorLeft, 90, 50);
         setMotorSpeed(MotorLeft, 40);
         waitUntil(getColorName(ColorRight)==colorBlack); //**Error**:Undefined procedure 'waitUntil'.
         setMotorSpeed(MotorLeft, 0);
         setMotorSpeed(MotorRight, 0);
         releaseCPU();
         break;

      case colorBlack:
         hogCPU();
         setMotorSpeed(MotorLeft, 50);
         setMotorSpeed(MotorRight, -50);
         waitUntil(getColorName(ColorRight)!=colorBlack);
         setMotorSpeed(MotorLeft, 0);
         setMotorSpeed(MotorRight, 0);
         releaseCPU();
         break;
      }
      hogCPU();
      setMotorSpeed(MotorLeft, 50);
      setMotorSpeed(MotorRight, -50);
      waitUntil(getColorName(ColorRight)!=colorBlack); //**Error**:Undefined procedure 'waitUntil'.
      setMotorSpeed(MotorLeft, 0);
      setMotorSpeed(MotorRight, 0);
      releaseCPU();
   }
}

task SensorLeft()
{
   repeat(forever)
   {
      switch (ColorLeft)
      {
      case colorGreen:
         hogCPU();
         resetMotorEncoder(MotorRight);
         setMotorTarget(MotorRight, 90, 50);
         setMotorSpeed(MotorRight, 40);
         waitUntil(getColorName(ColorLeft)==colorBlack); //**Error**:Undefined procedure 'waitUntil'.
         setMotorSpeed(MotorRight, 0);
         releaseCPU();
         break;

      case colorBlack:
         hogCPU();
         setMotorSpeed(MotorRight, 50);
         setMotorSpeed(MotorLeft, -50);
         waitUntil(getColorName(ColorLeft)!= colorBlack);
         setMotorSpeed(MotorLeft, 0);
         setMotorSpeed(MotorRight, 0);
         releaseCPU();
         break;
      }
      setMotorSpeed(MotorLeft, 50);
      waitUntil(getColorName(ColorLeft)!=colorBlack); //**Error**:Undefined procedure 'waitUntil'.
      setMotorSpeed(MotorLeft, 0);
      return;
   }
}

task SensorObstacle()
{
   repeat(forever)
   {
      if (SensorValue(Ultrasonic) < 3.5)
      {
         hogCPU();

         resetMotorEncoder(MotorRight);
         resetMotorEncoder(MotorLeft);
         setMotorSyncEncoder(MotorRight, MotorLeft, 0, 90, 50);
         resetMotorEncoder(MotorRight);
         resetMotorEncoder(MotorLeft);
         setMotorSyncEncoder(MotorRight, MotorLeft, -100, 90, 50);
         resetMotorEncoder(MotorRight);
         resetMotorEncoder(MotorLeft);
         setMotorSyncEncoder(MotorRight, MotorLeft, 0, 90, 50);
         resetMotorEncoder(MotorRight);
         resetMotorEncoder(MotorLeft);
         setMotorSyncEncoder(MotorRight, MotorLeft, 100, 90, 50);
         resetMotorEncoder(MotorRight);
         resetMotorEncoder(MotorLeft);
         setMotorSyncEncoder(MotorRight, MotorLeft, 0, 180, 50);
         resetMotorEncoder(MotorRight);
         resetMotorEncoder(MotorLeft);
         setMotorSyncEncoder(MotorRight, MotorLeft, 100, 90, 50);
         setMotorSync(MotorRight, MotorLeft, 0, 30);
         waitUntil(getColorName(ColorRight)==colorBlack); //**Error**:Undefined procedure 'waitUntil'.
         setMotorSync(MotorRight, MotorLeft, 0, 0);

         releaseCPU();
      }
   }
   return;
}

task main()
{
   sleep(1000);
   startTask(SensorObstacle, 10);
   startTask(SensorRight, 0);
   startTask(SensorLeft, 0);
}


I need a quick response please


Fri Mar 27, 2015 11:45 am
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: ROBOTC LEGO EV3 **Error**: Undefined procedure 'waitUnti
You need to enable Natural Language if you want to use those functions. You can do that here:
Attachment:
Screenshot at 12-01-17.png
Screenshot at 12-01-17.png [ 19.43 KiB | Viewed 5396 times ]

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Tue Mar 31, 2015 6:02 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 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.