Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Strange errors trying to upload a sketch from vs2010 (Read 5739 times)
Bender Robot
Newbies
*
Offline


Posts: 3
Joined: Mar 31st, 2015
Strange errors trying to upload a sketch from vs2010
Apr 3rd, 2015 at 1:21pm
Print Post  
While creating a test program for an microtronics board (used in reprap), i first tried it out on an uno first, so I selected the uno board, then uploaded and and i got these errors. they are a bit strange seam to indicate that use setup twice or so but i dont do that see below:


Compiling 'minitronicstest' for 'Arduino Uno'
minitronicstest.ino:In function 'void setup()'
LedTest.ino:7:6: error: redefinition of 'void setup()'
minitronicstest.ino:90:6: error: 'void setup()' previously defined here
minitronicstest.ino:At global scope
LedTest.ino:18:15: error: redefinition of 'long unsigned int prevMillis'
minitronicstest.ino:175:15: error: 'long unsigned int prevMillis' previously declared here
LedTest.ino:In function 'void loop()'
LedTest.ino:19:6: error: redefinition of 'void loop()'
minitronicstest.ino:177:6: error: 'void loop()' previously defined here
Error compiling

#
this was my test code

int PWMpin[]= {3,5,6,9};
int UsePin[]= {13,12,11,10};
int MaxTime =10;
int PWMcntr[]= {0,0,0,0};


void setup() {
  Serial.begin(9600);
  Serial.print("Starting...\n");

  delay(4000); // it takes 3 sec to start Bridge, i am just on safe side. that was for an older experiment
  for (int pinX=0;pinX<4;pinX++)
       {
       pinMode(UsePin[pinX],OUTPUT);
       }
}

unsigned long prevMillis;
void loop() {
     prevMillis = millis();
     if (prevMillis %100 <50) {digitalWrite(UsePin[0], HIGH);} else{digitalWrite(UsePin[0], LOW);}
     if (prevMillis %1000 <750) {digitalWrite(UsePin[1], HIGH);} else{digitalWrite(UsePin[1], LOW);}
     if (prevMillis %4000 <2050) {digitalWrite(UsePin[2], HIGH);} else{digitalWrite(UsePin[2], LOW);}
     }
« Last Edit: Apr 3rd, 2015 at 1:23pm by Bender Robot »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Strange errors trying to upload a sketch from vs2010
Reply #1 - Apr 3rd, 2015 at 1:30pm
Print Post  
Hi,

The way Arduino works is to compile all files in the sketch folder. To remain compatible with the Arduino ide we enforce and use the same rules.

The error suggests you have another .ino file in the sketch folder that has duplicate code.

Does this make sense?
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint