View unanswered posts | View active topics It is currently Fri Dec 19, 2014 8:12 pm






Reply to topic  [ 4 posts ] 
Error: Variable 'motor*' redefinition. 
Author Message
Expert
User avatar

Joined: Sat Sep 20, 2008 12:16 pm
Posts: 106
Location: Curently fighting aliens on P3X-828
Post Error: Variable 'motor*' redefinition.
I am getting the following error with 1.43 beta 1:
Line 110 **Error**:Variable 'motorD' redefinition.
Line 110 **Error**:Variable 'motorE' redefinition.

Here is my code:
Code:
#pragma config(Hubs,  S1, HTMotor,  HTServo,  none,     none)
#pragma config(Sensor, S3,     Light,               sensorLightActive)
#pragma config(Sensor, S4,     Sonar,               sensorSONAR)
#pragma config(Motor,  motorB,          ,              tmotorNormal, PIDControl, reversed)
#pragma config(Motor,  mtr_S1_C1_1,     motorD,        tmotorNormal, openLoop)
#pragma config(Motor,  mtr_S1_C1_2,     motorE,        tmotorNormal, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

int autotimer;
int mode2;
int mode3;

#include "JoystickDriver.c"

task main()

{
  autotimer = 0;
  mode2 = 1;
  mode3 = 1;

  while (autotimer < 300)
  {

     if (mode2 == 1)
     {
       if (SensorValue(Sonar) < 30)
       {
          mode2 = 2;
      }
    }
     if (mode2 == 1)
     {
       motor[motorD] = 100;
       motor[motorE] = 100;
    }
    if (mode2 == 2)
    {
       motor[motorD] = 75;
       motor[motorE] = - 75;
       wait10Msec (85);
       mode2 = 3;
       autotimer = autotimer + 10;
    }
    if (mode2 == 3)
    {
       motor[motorD] = 100;
       motor[motorE] = 100;
       if (SensorValue(Light) < 25)
       {
         wait10Msec (300);
         motor[motorD] = 75;
         motor[motorE] = - 75;
         wait10Msec (85);
         autotimer = autotimer + 40;
         motor[motorD] = 100;
         motor[motorE] = 100;
         wait10Msec (100);
         autotimer = autotimer + 10;
         if (SensorValue(Sonar) < 5);
         {
           mode3 = 2;
         }
      }
    }
    if (mode2 == 3 && mode3 == 2)
    {
       motor[motorD] = 0;
       motor[motorE] = 0;
       motor[motorA] = 100;
       wait10Msec (100);
       motor[motorA] = -100;
       motor[motorA] = 0;
       autotimer = 300;
    }
    wait10Msec (9);
    ++autotimer;
  }


  while(true)
  {
    while (true)
    {
      getJoystickSettings(joystick);
      motor[motorD] = joystick.joy1_y1;
      motor[motorE] = joystick.joy2_y1;

      if(joy1Btn(1))
      {
         motor[motorA] = 128;
      }
      else
      {
          motor[motorA] = ~ 128;
         motor[motorA] = 0;
      }
      if(joy2Btn(1))
      {
         motor[motorB] = 100;
      }
      else
      {
         motor[motorB] = 0;
      }
    }
  }
}

This is extremly wierd because the last line of code that I have is line 109. Could anyone please help? I don't get this error with my drive test program.

Edit: It must be a bug, because when I restarted the software, it compiled normaly.

Edit 2: It's BACK!!!

_________________
:downloading:
Sorry, your program could not be downloaded. Please reboot your computer.
FTC Team #2959 Team Smash Bros CLICK HERE.(or click www)
Quote:
What the world needs is more geniuses with humility, there are so few of us left.

Agreed


Mon Sep 22, 2008 3:54 pm
Profile WWW
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:42 am
Posts: 616
Post Re: Error: Variable 'motor*' redefinition.
Also a known issue. We're digging these out though and hope to have 1.44 very very soon.

Work around for the time being... name your motors something else (other than MotorD and MotorE) in Motors and Sensor Setup... and use those names in your program.

Code:
#pragma config(Motor,  mtr_S1_C1_1,     motor1,        tmotorNormal, openLoop)
#pragma config(Motor,  mtr_S1_C1_2,     motor2,        tmotorNormal, openLoop)

_________________
Timothy Friez
ROBOTC Developer - SW Engineer
tfriez@robotc.net


Mon Sep 22, 2008 4:48 pm
Profile
Expert
User avatar

Joined: Sat Sep 20, 2008 12:16 pm
Posts: 106
Location: Curently fighting aliens on P3X-828
Post Re: Error: Variable 'motor*' redefinition.
Thanks! That fixed that problem!

_________________
:downloading:
Sorry, your program could not be downloaded. Please reboot your computer.
FTC Team #2959 Team Smash Bros CLICK HERE.(or click www)
Quote:
What the world needs is more geniuses with humility, there are so few of us left.

Agreed


Mon Sep 22, 2008 6:01 pm
Profile WWW
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:42 am
Posts: 616
Post Re: Error: Variable 'motor*' redefinition.
Glad to hear it.

Problem is fixed in 1.44

_________________
Timothy Friez
ROBOTC Developer - SW Engineer
tfriez@robotc.net


Tue Sep 23, 2008 5:55 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 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.