OLED example compile error with Arduino Due

128x128 pixel 1.5" full colour OLED display with MicroSD card slot. [Product page]
Post Reply
gladbags
Posts: 2
Joined: Tue Oct 22, 2013 4:57 am

OLED example compile error with Arduino Due

Post by gladbags » Mon Oct 28, 2013 7:54 am

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.
Attachments
Document.txt
Verbose error text
(1.54 KiB) Downloaded 83 times

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: OLED example compile error with Arduino Due

Post by angusgr » Mon Oct 28, 2013 9:46 pm

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

gladbags
Posts: 2
Joined: Tue Oct 22, 2013 4:57 am

Re: OLED example compile error with Arduino Due

Post by gladbags » Tue Oct 29, 2013 7:42 am

Angus

All fixed, thanks for that.

aijii
Posts: 16
Joined: Thu Oct 03, 2013 12:06 pm

Re: OLED example compile error with Arduino Due

Post by aijii » Sat Nov 30, 2013 10:31 pm

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

PaulStoffregen
Posts: 2
Joined: Sun Dec 01, 2013 12:14 am

Re: OLED example compile error with Arduino Due

Post by PaulStoffregen » Sun Dec 01, 2013 12:16 am

I submitted a very simple pull request to fix this on Teensy 3.0.

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

PaulStoffregen
Posts: 2
Joined: Sun Dec 01, 2013 12:14 am

Re: OLED example compile error with Arduino Due

Post by PaulStoffregen » Sun Dec 01, 2013 1:11 am

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)"

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: OLED example compile error with Arduino Due

Post by angusgr » Sun Dec 01, 2013 9:21 pm

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.

harada57
Posts: 4
Joined: Sun Aug 06, 2017 3:38 am

Re: OLED example compile error with Arduino Due

Post by harada57 » Sun Aug 06, 2017 8:37 am


Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests