I am trying to create a program for autonomous and manual control mode and I keep having the following errors: **Error**:Undefined variable 'motorA'. 'short' assumed.**Error**:Undefined variable 'motorB'. 'short' assumed.**Error**:Undefined variable 'leftMotor'. 'short' assumed.**Error**:Undefined variable 'rightMotor'. 'short' assumed.

///////////////////////////////////////////////////////////////////////////////////////////// Pre-Autonomous Functions//// You may want to perform some actions before the competition starts. Do them in the// following function.///////////////////////////////////////////////////////////////////////////////////////////

void pre_auton(){ // Set bStopTasksBetweenModes to false if you want to keep user created tasks running between // Autonomous and Tele-Op modes. You will need to manage all user created tasks if set to false. bStopTasksBetweenModes = true;

///////////////////////////////////////////////////////////////////////////////////////////// Autonomous Task//// This task is used to control your robot during the autonomous phase of a VEX Competition.// You must modify the code to add your own robot specific commands here.///////////////////////////////////////////////////////////////////////////////////////////

task autonomous(){ motor[motorA] = 100; //motor A is run at a 100 power level motor[motorB] = 100; //motor A is run at a 100 power level wait1Msec(4000); //the program waits 4000 milliseconds before running further code

motor[motorA] = -100; //motor A is run at a 100 power level motor[motorB] = -100; //motor A is run at a 100 power level wait1Msec(4000); //the program waits 4000 milliseconds before running further code}

///////////////////////////////////////////////////////////////////////////////////////////// User Control Task//// This task is used to control your robot during the user control phase of a VEX Competition.// You must modify the code to add your own robot specific commands here.///////////////////////////////////////////////////////////////////////////////////////////

This question was answered in this thread: viewtopic.php?f=63&t=5483&p=22797#p22797 ; the issue was that none of the motors were assigned aliases (names) and that the program was using NXT motors (motorA, motorB, etc) in a VEX competition template. In the future, please refrain from posting the same question multiple times as it divides the conversation and can cause confusion. Thank you!

Who is online

Users browsing this forum: No registered users and 0 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum