adafruit / Adafruit_SSD1306

Arduino library for SSD1306 monochrome 128x64 and 128x32 OLEDs
http://www.adafruit.com/category/63_98
Other
1.78k stars 976 forks source link

pgmspace.h: No such file or directory for Raspberry Pi Pico #259

Open ghost opened 1 year ago

ghost commented 1 year ago

The error I get when trying to compile the example file "ssd1306_128x64_12c" is the following:

Adafruit_SSD1306.cpp:42:10: fatal error: pgmspace.h: No such file or directory

Lines 39-42 of such cpp file looks like this:

ifdef AVR

include <avr/pgmspace.h>

elif defined(ESP8266) || defined(ESP32) || defined(ARDUINO_ARCH_RP2040)

include

If I modify line 42 like this:

include <avr/pgmspace.h>

then the sketch compiles and works as expected.

So it seems that the Pico uses the avr pgmspace, maybe this can be modified in the cpp file Thanks!

cscott commented 1 year ago

It works fine if you use version 2.5.1 fwiw:

lib_deps = 
    adafruit/Adafruit SSD1306@2.5.1

(Don't use the ^ symbol after the @ sign or it will use "a version compatible with 2.5.1" and it thinks that 2.5.2 and above are "compatible".)

cscott commented 1 year ago

Seems like https://github.com/adafruit/Adafruit_SSD1306/commit/3fb7221784be255fae7b4eba219039e398aed442 is at fault; they added support for the RP2040 Feather and somehow broke the RP2040 pico in the process.

germtown commented 1 year ago

Switching to 2.5.1 (from 2.5.7) worked for me to get things building, I feel lucky this was my first search result!

jptp13 commented 4 months ago

Hi Same issue for Arduino Nano ESP32 "Compilation error: avr/pgmspace.h: No such file or directory" Any workaround? Thanks