Page 1 of 1

OLED example compile error with Arduino Due

Posted: Mon Oct 28, 2013 7:54 am
by gladbags
I am migrating an OLED application from an EtherMega to an Arduino Due.

Both the 'fonts_demo' and the 'stripchart' examples compile and run successfully on the EtherMega.

When I select the Board as an Arduino Due in Arduino 1.5.4, I get the following compile errors on all the examples.

C:\Freetronics\libraries\FTOLED/progmem_compat.h:19: error: expected unqualified-id before 'const'
C:\Freetronics\libraries\FTOLED/progmem_compat.h:19: error: expected ')' before 'const'
C:\Freetronics\libraries\FTOLED/progmem_compat.h:19: error: expected ')' before 'const'

I have attached a verbose compile error message, if that can help.

The blink example for the Arduino Due compiles and runs on the Due board without any issues.

Any help would be appreciated.

Re: OLED example compile error with Arduino Due

Posted: Mon Oct 28, 2013 9:46 pm
by angusgr
Hi gladbags,

Thanks for pointing this one out. Ironically, the error was caused by changes in FTOLED that were added to support the Due with Arduino 1.5.2. It looks like the Arduino team added their own solution to the same problem in version 1.5.3, and I hadn't tested FTOLED with the newer Arduino IDE versions.

I just updated the library so it should now work with 1.5.2, 1.5.3 or 1.5.4. Sorry for the inconvenience.

- Angus

Re: OLED example compile error with Arduino Due

Posted: Tue Oct 29, 2013 7:42 am
by gladbags
Angus

All fixed, thanks for that.

Re: OLED example compile error with Arduino Due

Posted: Sat Nov 30, 2013 10:31 pm
by aijii
hi there,

So I get this when I run a teensy 3.0, using arduino 1.0.5.

I've upgraded the libraries and still get the issue...

In file included from C:\Users\adrian\Documents\Arduino\libraries\FTOLED/FTOLED.h:42:0,
from aijii_wrx_display_teensy.ino:29:
C:\Users\adrian\Documents\Arduino\libraries\FTOLED/progmem_compat.h:23:23: error: expected unqualified-id before 'const'
C:\Users\adrian\Documents\Arduino\libraries\FTOLED/progmem_compat.h:23:23: error: expected ')' before 'const'
C:\Users\adrian\Documents\Arduino\libraries\FTOLED/progmem_compat.h:23:23: error: expected ')' before 'const'

This code compiled perfectly for a MEGA2560

Re: OLED example compile error with Arduino Due

Posted: Sun Dec 01, 2013 12:16 am
by PaulStoffregen
I submitted a very simple pull request to fix this on Teensy 3.0.

https://github.com/freetronics/FTOLED/pull/3

Re: OLED example compile error with Arduino Due

Posted: Sun Dec 01, 2013 1:11 am
by PaulStoffregen
Also, in case anyone's interested, Arduino 1.5.3 used the avr/pgmspace.h macros from Teensy 3.0 to make Due compatible with more libraries.

If you look at Arduino's release notes, under "ARDUINO 1.5.3 BETA 2013.08.30", it says:

"* sam: Added compatibility for avr/pgmspace.h (Paul Stoffregen)"

Re: OLED example compile error with Arduino Due

Posted: Sun Dec 01, 2013 9:21 pm
by angusgr
Thanks Paul, I just merged your pull request.

As you probably noted, the header in FTOLED was just the bare minimum necessary for the library to compile. Nice work noop-ing out all of the various pgmspace macros, I'm glad the Arduino team took your work onboard.