0

sketch compiles for MEGA but not UNO
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

sketch compiles for MEGA but not UNO

by jes on Sun Oct 02, 2016 11:19 pm

XP system with IDE 1.6.9 - the following example compiles fine for MEGA but not for UNO; why?

Code: Select all | TOGGLE FULL SIZE
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  pinMode(9, OUTPUT); 
  analogWrite(9, 50);   
  lcd.begin(16, 2);
  lcd.print("  Hello");
}

void loop() {
  lcd.setCursor(0, 1);
  lcd.print(millis()/1000);
}

when trying to compile for UNO it comes with this error:

collect2.exe: error: ld returned 5 exit status

exit status 1
Error compiling for board Arduino/Genuino Uno.

jes
 
Posts: 23
Joined: Sat Nov 23, 2013 9:37 pm

Re: sketch compiles for MEGA but not UNO

by franklin97355 on Mon Oct 03, 2016 12:17 am

Not sure what the problem is. I just copied your code and compiled it without errors using 1.6.9 on Windows 8.1 for the Uno

franklin97355
 
Posts: 19398
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: sketch compiles for MEGA but not UNO

by jes on Mon Oct 03, 2016 11:31 am

Same here - my IDE 1.6.9 has no problem with compiling it for UNO when it runs under Win 7 and 8.
But for some reason it does not like Win XP - go figure..

jes
 
Posts: 23
Joined: Sat Nov 23, 2013 9:37 pm

Re: sketch compiles for MEGA but not UNO

by franklin97355 on Mon Oct 03, 2016 11:39 am

Have you tried removing the IDE and the Arduino15 folder in C:\Users\<username>\AppData\Local Then reinstalling? That's the only thing I can think of.

franklin97355
 
Posts: 19398
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: sketch compiles for MEGA but not UNO

by jes on Tue Oct 04, 2016 2:36 am

Thanks - took me 2 hours to figure it out but your advise did the trick!

jes
 
Posts: 23
Joined: Sat Nov 23, 2013 9:37 pm

Please be positive and constructive with your questions and comments.