[Issue] Store bitmap in photon

I have a LCD connected to my Photon that can display bitmaps and the included code has an example for it. The .cpp file that has the bitmap declares it has shown:

const unsigned char GUI_STORAGE_PTR acTuzki[] = { Bitmap data };

But when I compile I have an error saying: “expected initializer before ‘acTuzki’”
Does anybody knows how I can fix it? Do I need an extra library for that or not?
The original code for the LCD can be found Here in the BitmapDisplay folder.

Generally what you need is a graphics library and a driver for the controller on the specific LCD screen you are using.

Adafruit_GFX is a common graphics library with functions to write to bitmapped screens; text, lines, shapes, colour, .bmp picture files and bitmaps (single colour).

Strongly suggest you look in the community library for Adafruit_GFX_RK - there are some good updates by Rick Kass.

What exactly is GUI_STORGATE_PTR in your declaration. The char array name is acTuzki, which by definition is already a pointer. The correct declaration should be:
const unsigned char acTuzki[] = { Bitmap data };


I don’t know if that’s what you wanted but I found a way to get rid of my error by including avr/pgmspace.h to my project but now I have more errors in the library. But those errors only appears when I try to use the function for drawing bitmaps.

errors are:
expacted class-name before ‘{’ token
‘size_t’ does not name a type
‘Print’ has not been declared

@Justin-B, the ARM processors used in the Particle devices don’t have separate code and “progmem” areas. All memory is contiguous and in a single space.

One way to get around Arduino code problems is to include the Arduino.h file specifically designed by Particle to add compatibility. If that doesn’t work, share your code so we can take a look

It works when I add the Arduino Header. Thanks a lot @peekay123.

1 Like