Help with custom library and bitmaps ?

Hi guys I wanted to make a custom library for my project that would have all of my bitmaps stored, so I can pull them from the library. I got the library into the Arduino ide but I always got errors while compiling. I searched but couldn't find any answer. I'm using esp32 and basic oled lcd. I think the problem is in the library formatting but I couldn't find any library that has bitmap in it and is used.

Here is the .h file

#ifndef SokaraOsBitmaps_h
#define SokaraOsBitmaps_h

#include <Arduino.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>



public:
  static const unsigned char sokaraOsBooting[];
  static const unsigned char sokaraOsIntroScreen[];

#endif

Here is the .cpp file

#ifndef SokaraOsBitmaps_h
#define SokaraOsBitmaps_h

#include "SokaraOsBitmaps.h"
#include "Arduino.h
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

const unsigned char sokaraOsIntroScreen[] PROGMEM = {
	(the bitmap)
};

const unsigned char sokaraOsBooting[] PROGMEM = {
  (the bitmap)
};
#endif

Here is the function in which I display the bitmap into oled lcd

void sokaraOsBooting() {
  display.clearDisplay();
  display.setCursor(0, 0);
  display.drawBitmap(0, 0, sokaraOsBooting, 128, 64, SSD1306_WHITE);
  display.display();
}

Here is the error it throws

In file included from D:\arduino\Sokara OS\SokaraOs\SokaraOs\SokaraOs.ino:1:
c:\Users\cornw\Documents\Arduino\libraries\SokaraOsBitmaps/SokaraOsBitmaps.h:18:1: error: expected unqualified-id before 'public'
 public:
 ^~~~~~
c:\Users\cornw\Documents\Arduino\libraries\SokaraOsBitmaps/SokaraOsBitmaps.h:20:30: error: uninitialized const 'sokaraOsIntroScreen' [-fpermissive]
   static const unsigned char sokaraOsIntroScreen[];
                              ^~~~~~~~~~~~~~~~~~~
c:\Users\cornw\Documents\Arduino\libraries\SokaraOsBitmaps/SokaraOsBitmaps.h:20:30: error: storage size of 'sokaraOsIntroScreen' isn't known
D:\arduino\Sokara OS\SokaraOs\SokaraOs\SokaraOs.ino: In function 'void sokaraOsBooting()':
D:\arduino\Sokara OS\SokaraOs\SokaraOs\SokaraOs.ino:350:67: error: no matching function for call to 'Adafruit_SSD1306::drawBitmap(int, int, void (&)(), int, int, int)'
   display.drawBitmap(0, 0, sokaraOsBooting, 128, 64, SSD1306_WHITE);
                                                                   ^
In file included from c:\Users\cornw\Documents\Arduino\libraries\SokaraOsBitmaps/SokaraOsBitmaps.h:13,
                 from D:\arduino\Sokara OS\SokaraOs\SokaraOs\SokaraOs.ino:1:
c:\Users\cornw\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:84:8: note: candidate: 'void Adafruit_GFX::drawBitmap(int16_t, int16_t, const uint8_t*, int16_t, int16_t, uint16_t)'
   void drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w,
        ^~~~~~~~~~
c:\Users\cornw\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:84:8: note:   no known conversion for argument 3 from 'void()' to 'const uint8_t*' {aka 'const unsigned char*'}
c:\Users\cornw\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:86:8: note: candidate: 'void Adafruit_GFX::drawBitmap(int16_t, int16_t, const uint8_t*, int16_t, int16_t, uint16_t, uint16_t)'
   void drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w,
        ^~~~~~~~~~
c:\Users\cornw\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:86:8: note:   candidate expects 7 arguments, 6 provided
c:\Users\cornw\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:88:8: note: candidate: 'void Adafruit_GFX::drawBitmap(int16_t, int16_t, uint8_t*, int16_t, int16_t, uint16_t)'
   void drawBitmap(int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h,
        ^~~~~~~~~~
c:\Users\cornw\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:88:8: note:   no known conversion for argument 3 from 'void()' to 'uint8_t*' {aka 'unsigned char*'}
c:\Users\cornw\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:90:8: note: candidate: 'void Adafruit_GFX::drawBitmap(int16_t, int16_t, uint8_t*, int16_t, int16_t, uint16_t, uint16_t)'
   void drawBitmap(int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h,
        ^~~~~~~~~~
c:\Users\cornw\Documents\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:90:8: note:   candidate expects 7 arguments, 6 provided

exit status 1

Compilation error: no matching function for call to 'Adafruit_SSD1306::drawBitmap(int, int, void (&)(), int, int, int)'

Any idea or at least any help would be appreciated :sob:

Hi thanks for the reply I managed to tackle a couple of errors thanks to you, fixed the code into this

the .h file

#ifndef SokaraOsBitmaps_h
#define SokaraOsBitmaps_h

#include <Arduino.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

unsigned char sokaraOsBooting [] PROGMEM;
unsigned char sokaraOsIntroScreen [] PROGMEM;

#endif

I haven't changed other files. But I still got 2 errors left.

In file included from D:\arduino\Sokara OS\SokaraOs\SokaraOs\SokaraOs.ino:1:
c:\Users\cornw\Documents\Arduino\libraries\SokaraOsBitmaps/SokaraOsBitmaps.h:16:15: error: storage size of 'sokaraOsBooting' isn't known
 unsigned char sokaraOsBooting [] PROGMEM;
               ^~~~~~~~~~~~~~~
c:\Users\cornw\Documents\Arduino\libraries\SokaraOsBitmaps/SokaraOsBitmaps.h:17:15: error: storage size of 'sokaraOsIntroScreen' isn't known
 unsigned char sokaraOsIntroScreen [] PROGMEM;
               ^~~~~~~~~~~~~~~~~~~

exit status 1

Compilation error: exit status 1

tried looking at internet and tried a couple of solutions but none of them worked any idea why? :smiling_face_with_tear:

unsigned char sokaraOsBooting [] PROGMEM;

You are declaring an array without specifying how many elements it consists of

Hi thanks for the answer could you maybe help me with the size specifying ? I kind of don't know how to set the size for the array for the bitmap and there isn't much on the net :?

Where does the contents of the 2 arrays come from ?

From the .cpp file that contains the 2 bitmaps.

I think that you mean the .h files that contain the bitmaps

Please post one of them

I have the bitmaps stored inside the .cpp file.

Here is the .cpp file

#include "SokaraOsBitmaps.h"
#include <Arduino.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

unsigned char sokaraOsIntroScreen [] PROGMEM = {
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x1f, 0xd3, 0xdf, 0xfd, 0x21, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x1f, 0x7d, 0xef, 0xff, 0xb7, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x0d, 0xd4, 0xef, 0xfb, 0x92, 0x77, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x1f, 0xb6, 0x77, 0xfe, 0xd9, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x13, 0xfb, 0x77, 0xff, 0xed, 0xa7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x1b, 0xcd, 0x3b, 0xff, 0x66, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x0d, 0xfd, 0x39, 0xf7, 0xda, 0xc7, 0xff, 0xff, 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, 0xcf, 0xe7, 
	0x1d, 0x3f, 0xda, 0x30, 0x32, 0x67, 0xf3, 0x3d, 0xe6, 0x73, 0x9c, 0xf9, 0xcf, 0xe7, 0xcf, 0xe7, 
	0x1d, 0xab, 0x72, 0x59, 0x0a, 0x07, 0xf3, 0xb9, 0xe6, 0x73, 0xbc, 0xf9, 0x9f, 0xe3, 0x9d, 0xe7, 
	0x3f, 0x3b, 0xd2, 0x79, 0x21, 0x86, 0x77, 0x99, 0xcf, 0x33, 0x9c, 0xf9, 0x8f, 0xf3, 0x9c, 0xe7, 
	0x1d, 0x66, 0xd8, 0x62, 0x24, 0x26, 0x0f, 0xc7, 0xc6, 0x19, 0x98, 0x7c, 0xcf, 0xfc, 0x7c, 0x1f, 
	0x1f, 0x34, 0xe8, 0xc6, 0x84, 0x27, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x3d, 0x81, 0xba, 0x3d, 0x11, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x1d, 0x01, 0xba, 0xcd, 0x00, 0x47, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x1f, 0x04, 0x6e, 0xf6, 0x2a, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x1f, 0x80, 0xf7, 0xb6, 0x08, 0x27, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x1d, 0x84, 0x59, 0xb9, 0x81, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x1d, 0x94, 0xee, 0xcc, 0x20, 0x47, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x1e, 0xbe, 0x7b, 0x76, 0x08, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x1e, 0x9c, 0xdb, 0x72, 0x81, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x1b, 0x93, 0xec, 0xd8, 0x84, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x1c, 0xc3, 0x76, 0xdd, 0x00, 0x07, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x17, 0x8d, 0xd9, 0x64, 0x40, 0x80, 0x63, 0xff, 0xff, 0xfe, 0x7f, 0xff, 0xff, 0xe3, 0xff, 0xdf, 
	0x19, 0xc7, 0x6c, 0x76, 0x00, 0x04, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcc, 0xff, 0x1f, 
	0x0c, 0x4d, 0xb0, 0xd9, 0x00, 0x04, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdc, 0xff, 0x1f, 
	0x0f, 0x65, 0xb0, 0xd9, 0x04, 0x86, 0x77, 0x8e, 0x33, 0x1c, 0x78, 0xf3, 0x3f, 0xcc, 0xff, 0x9f, 
	0x09, 0x86, 0xd9, 0x84, 0x00, 0x26, 0x77, 0x33, 0x26, 0x6c, 0xf3, 0x72, 0x1f, 0x9c, 0xff, 0x9f, 
	0x0a, 0x62, 0x6f, 0x02, 0x00, 0x26, 0x6f, 0x73, 0x96, 0x6e, 0x67, 0x39, 0x9f, 0x9c, 0xff, 0x9f, 
	0x0b, 0x23, 0x34, 0x02, 0x00, 0xc6, 0x6f, 0x73, 0x3e, 0x7e, 0x67, 0x33, 0x9f, 0xde, 0xff, 0x9f, 
	0x05, 0xb0, 0xd8, 0x28, 0x80, 0x46, 0x6f, 0x03, 0xbf, 0x1e, 0xe7, 0x3b, 0x9f, 0x9c, 0xff, 0x9f, 
	0x14, 0x10, 0x88, 0x84, 0x00, 0x47, 0x1e, 0x7f, 0x3f, 0x8e, 0x67, 0x3b, 0x9f, 0x9c, 0xff, 0x9f, 
	0x03, 0x52, 0x24, 0x11, 0x01, 0x47, 0x1f, 0x3f, 0x3f, 0xce, 0x67, 0x33, 0x9f, 0xcc, 0xff, 0x9f, 
	0x08, 0xc8, 0x21, 0x00, 0x01, 0x87, 0x1f, 0x3b, 0xbe, 0xec, 0xf7, 0x3b, 0x9f, 0xcd, 0xff, 0x9f, 
	0x12, 0x28, 0x18, 0x4c, 0x00, 0x87, 0x3f, 0x07, 0x3e, 0xce, 0x73, 0x73, 0x1f, 0xcd, 0xcf, 0x9f, 
	0x12, 0x44, 0x06, 0x10, 0x02, 0x97, 0xbf, 0xcf, 0x1f, 0x1c, 0x78, 0xf1, 0x1f, 0xf3, 0xee, 0x07, 
	0x09, 0x54, 0x01, 0x24, 0x00, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x0c, 0x22, 0x00, 0xc8, 0x05, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x11, 0xaa, 0x00, 0x10, 0x03, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x14, 0x09, 0x00, 0x10, 0x04, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x0f, 0x44, 0x80, 0x00, 0x05, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x03, 0x30, 0x80, 0x00, 0x0e, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x10, 0x82, 0x40, 0x00, 0x0c, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x0c, 0x90, 0x30, 0x00, 0x0d, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x02, 0x4c, 0x84, 0x00, 0x0c, 0x4f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x11, 0x00, 0x00, 0x00, 0x10, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x00, 0x21, 0x00, 0x00, 0x10, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0x36, 0xdb, 0x6d, 0xa4, 0xb6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};

unsigned char sokaraOsBooting [] PROGMEM = {
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xf3, 0x33, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcc, 0xcf, 
	0xe2, 0x13, 0xff, 0x73, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc4, 0x47, 
	0xe8, 0x89, 0xff, 0x7b, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x90, 0x37, 
	0xe8, 0x25, 0xff, 0x7b, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0x0f, 
	0xe6, 0x13, 0xff, 0x7b, 0xfc, 0x7f, 0xc7, 0xfc, 0x3f, 0xc7, 0xfd, 0x1f, 0xe2, 0xff, 0xc8, 0x67, 
	0xf0, 0x93, 0xff, 0x77, 0xf8, 0x3f, 0x83, 0xfc, 0x3f, 0xc7, 0xfc, 0x1f, 0xe0, 0xff, 0x92, 0x17, 
	0xe4, 0x09, 0xff, 0x1f, 0xf3, 0xbf, 0xb9, 0xfe, 0xff, 0xf7, 0xfc, 0xcf, 0xcc, 0xff, 0xc4, 0x97, 
	0xe3, 0x21, 0xff, 0x07, 0xf7, 0x9f, 0xbd, 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ff, 0xfe, 0xff, 0xfb, 0xbf, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdd, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe1, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};

and here is the .h file

#ifndef SokaraOsBitmaps_h
#define SokaraOsBitmaps_h

#include <Arduino.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

unsigned char sokaraOsBooting [] PROGMEM;
unsigned char sokaraOsIntroScreen [] PROGMEM;

#endif

OK, so the array is declared in the .cpp file, not in the .h file. Unusual, but it could work

unsigned char sokaraOsIntroScreen [] PROGMEM = {
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
etc, etc, etc

This is the declaration of the array. The compiler will work out how many elements the array has from the data supplied so there is no number in the square brackets

As the array is declared as part of the library you do not need, indeed must not, declare another array of the same name with a different scope

So if I must not declare another array of the same name do I just remove the array from the .h file or how am I supposed to not declare the same name array ? Because when I remove it it just compiles into many errors.

Put the declaration and the definition of the arrays in the .h file where they belong and nowhere else. Then, when you #include the .h file the arrays will be available to the sketch

As an alternative you could put the declaration and definition of the arrays in the sketch itself,

Either way only put it in one place

Oh that makes sense and what should I do with the .cpp file not use it ? And if I yes I guess I shouldnt put the arrays in there ?

You do not need the .cpp file for what you are doing

Thanks for the help. I deleted the .cpp file, added the bitmaps into the .h file and everything works as intended :smile_cat:

Sounds good and is also the standard way in which .h files are used

1 Like

I found problems to insert the "void" you made in the general code.

Also I found some dificulties to use animated bitmaps from wokwi animations. Have you ever tried?

Wokwi OLED Animation Maker for Arduino

void sokaraOsBooting() {
  display.clearDisplay();
  display.setCursor(0, 0);
  display.drawBitmap(0, 0, sokaraOsBooting, 128, 64, SSD1306_WHITE);
  display.display();
}

I tried to insert it several times with plenty of problems to compile. Maybe because I tried with animated bitmaps and I specified also the frames.

Could you share the full arduino code, ccp and h library? Thanks in advance.

First, I have tried with that Arduino code.


#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <NinjagoOsBitmap.h>

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels

// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET     -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

void setup() {
  Serial.begin(9600);

  // SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { 
    Serial.println(F("SSD1306 allocation failed"));
    for(;;); // Don't proceed, loop forever
  }

  void Ninjago_intro_Screen() {
    display.clearDisplay();
    display.setCursor(0, 0);
    display.drawBitmap(0, 0, Ninjago_intro_Screen, 128, 64, SSD1306_WHITE);
    display.display();
}

void loop() {
}

for the *.h file I have written that one:

#ifndef NinjagoOsBitmap_h
#define NinjagoOsBitmap_h

#include <Arduino.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

unsigned char Ninjago_intro_Screen [] PROGMEM = {
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-------to avoid too much characters-----
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
unsigned char Ninjago_final_Screen [] PROGMEM = = {
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-------to avoid too much characters-----
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
#endif

and for the ccp, I have written this:

#include "NinjagoOsBitmaps.h"
#include <Arduino.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

unsigned char Ninjago_intro_Screen [] PROGMEM = {
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
--------avoiding too many characters--------- 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};

unsigned char Ninjago_final_Screen [] PROGMEM = {
    0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
--------avoiding too many characters--------- 
	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};

What is wrong. It doesnt even compile....

Please show the compiler error message

you put the Ninjago_intro_Screen() inside the setup(), C/C++ doesn't allow a nested functions

Thank you all for that support. :smiley:

I'm beginner on this, and Im triying to do something for my kids to encourage them at programming. :smiley:

I've modified the code:


#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <NinjagoOsBitmaps.h>

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define ALTURA_LOGO 27
#define ANCHO_LOGO 120
#define FRAME_DELAY 100

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

static const unsigned char logo [] PROGMEM = {
  0x0f, 0xc0, 0x0f, 0xf8, 0x60, 0x07, 0x1f, 0xf3, 0xff, 0xc3, 0xff, 0xe1, 0xff, 0xff, 0x80, 0x07,
  0xe0, 0x0f, 0xf0, 0x70, 0x07, 0x8f, 0xf3, 0xff, 0xc7, 0xff, 0xc3, 0xff, 0xff, 0x00, 0x03, 0xf0,
  0x0f, 0xe2, 0x78, 0x07, 0xe7, 0xf3, 0xff, 0xcf, 0xff, 0x87, 0xff, 0xfe, 0x00, 0x01, 0xf8, 0x0f,
  0xc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1e, 0x7c, 0x0f, 0x87, 0x8f, 0x87, 0xf1, 0xf1, 0xe7, 0xc0, 0xf0, 0x00,
  0x00, 0x78, 0x0f, 0x1e, 0x7c, 0x07, 0x87, 0x8f, 0x03, 0xf9, 0xff, 0xe7, 0xff, 0xf0, 0x00, 0x00,
  0x7c, 0x07, 0x1e, 0x7c, 0x03, 0x87, 0x1f, 0x01, 0xf8, 0xff, 0xe7, 0xff, 0xf0, 0x00, 0x00, 0x7e,
  0x03, 0x1e, 0x7c, 0x01, 0x8f, 0x3e, 0x00, 0xfc, 0xff, 0xe3, 0xff, 0xf8, 0x00, 0x00, 0x7f, 0x01,
  0x9e, 0x3c, 0x00, 0x9e, 0x3e, 0x00, 0x7c, 0x3f, 0xe1, 0xff, 0xfc, 0x00, 0x00, 0x7e, 0x00, 0x00,
  0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00,
  0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x01, 0xf0, 0x00, 0x00, 0x00, 0x00,
  0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x80, 0x07, 0xe0, 0x00, 0x00, 0x00, 0x00, 0xe0,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xe0, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xf8, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00
} ;


void setup() {
  Serial.begin(9600);
  if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
    Serial.println(F("SSD1306 allocation failed"));
    for (;;);
  }

  // Pause for 2 seconds
  delay(2000);
  // Clear the buffer.
  display.clearDisplay();

  // Draw bitmap on the screen
  display.drawBitmap( 4, 13, logo, ANCHO_LOGO, ALTURA_LOGO, WHITE);
  display.display();
  for (int i = 0 ; i <= 40; i++) {
    display.invertDisplay(true);
    display.display();
    delay(50);
    display.invertDisplay(false);
    display.display();
    delay(50);
  }
  delay(5000);
  display.clearDisplay();
  display.setTextSize(1);      // Normal 1:1 pixel scale
  display.setTextColor(SSD1306_WHITE); // Draw white text
  display.setCursor(0, 0);     // Start at top-left corner
  display.println(F("Bienvenido a NINJAGO"));
  display.println(F("Comencemos"));
  display.display();
  display.clearDisplay();
  for (int a = 0 ; a <= 48; a++) {
    display.clearDisplay();
    display.drawBitmap(40, 8, reloj_arena[a], FRAME_WIDTH, FRAME_HEIGHT, WHITE);
    display.display();
    delay(FRAME_DELAY);
  }

}

void loop() {

}

However, I cannot display reloj_arena. It doesn't allow compillation, bcause it says that there is an error for Arduino Mega or Mega 2560.

Later I realized that, if I remove the library, it works. So the problem seems related with the .h and .ccp

The .h code:


#ifndef NinjagoOsBitmaps_h

#define NinjagoOsBitmaps_h

#include <Arduino.h>

#include <Wire.h>

#include <Adafruit_GFX.h>

#include <Adafruit_SSD1306.h>

static const unsigned char reloj_arena [] PROGMEM;

static const unsigned char sonando_musica [] PROGMEM;

static const unsigned char play_music [] PROGMEM;

static const unsigned char reduce_vol [] PROGMEM;

static const unsigned char increase_vol [] PROGMEM;

static const unsigned char pause [] PROGMEM;

static const unsigned char candado [] PROGMEM;

#endif

and cpp:

#include "NinjagoOsBitmaps.h"
#include <Arduino.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define FRAME_DELAY (42)
#define FRAME_WIDTH (48)
#define FRAME_HEIGHT (48)
#define FRAME_COUNT_RELOJ_ARENA (sizeof(reloj_arena) / sizeof(reloj_arena[0]))
#define FRAME_COUNT_SONANDO_MUSICA (sizeof(sonando_musica) / sizeof(sonando_musica[0]))
#define FRAME_COUNT_PLAY_MUSIC (sizeof(play_music) / sizeof(play_music[0]))
#define FRAME_COUNT_REDUCE_VOL (sizeof(reduce_vol) / sizeof(reduce_vol[0]))
#define FRAME_COUNT_INCREASE_VOL (sizeof(increase_vol) / sizeof(increase_vol[0]))
#define FRAME_COUNT_INCREASE_VOL (sizeof(pause) / sizeof(pause[0]))
#define FRAME_COUNT_CANDADO (sizeof(candado) / sizeof(candado[0]))

const byte PROGMEM reloj_arena[][288] = {
--the bitmap, I have removed some lines----
  {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,128,0,0,0,0,15,192,0,0,0,0,28,192,0,0,0,0,56,192,0,0,0,0,112,192,0,0,0,0,224,192,0,0,0,1,192,192,0,0,0,3,128,192,0,0,0,7,0,192,0,0,0,14,0,192,96,0,0,28,0,192,112,0,0,56,0,192,56,0,63,240,0,192,12,0,127,224,0,192,6,0,224,192,0,192,7,0,192,192,0,198,3,0,192,192,0,199,131,0,192,192,0,193,129,128,192,192,0,192,193,128,192,192,0,192,193,128,192,192,0,192,65,128,192,192,0,192,65,128,192,192,0,192,193,128,192,192,0,192,193,128,192,192,0,193,129,128,192,192,0,199,131,0,192,192,0,198,3,0,224,192,0,192,7,0,127,224,0,192,6,0,63,240,0,192,12,0,0,56,0,192,56,0,0,28,0,192,112,0,0,14,0,192,96,0,0,7,0,192,0,0,0,3,128,192,0,0,0,1,192,192,0,0,0,0,224,192,0,0,0,0,112,192,0,0,0,0,56,192,0,0,0,0,28,192,0,0,0,0,15,192,0,0,0,0,3,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
};

const byte PROGMEM sonando_music[][288] = {

--the bitmap, I have removed some lines----
  {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,128,0,0,0,0,15,192,0,0,0,0,28,192,0,0,0,0,56,192,0,0,0,0,112,192,14,0,0,0,224,192,7,0,0,1,192,192,3,192,0,3,128,192,0,192,0,7,0,192,0,96,0,14,0,192,96,48,0,28,0,192,112,56,0,56,0,192,56,24,63,240,0,192,12,12,127,224,0,192,6,12,224,192,0,192,7,6,192,192,0,198,3,6,192,192,0,199,131,3,192,192,0,193,129,131,192,192,0,192,193,131,192,192,0,192,193,131,192,192,0,192,65,131,192,192,0,192,65,131,192,192,0,192,193,131,192,192,0,192,193,131,192,192,0,193,129,131,192,192,0,199,131,3,192,192,0,198,3,6,224,192,0,192,7,6,127,224,0,192,6,12,63,240,0,192,12,12,0,56,0,192,56,24,0,28,0,192,112,56,0,14,0,192,96,48,0,7,0,192,0,96,0,3,128,192,0,192,0,1,192,192,3,192,0,0,224,192,7,0,0,0,112,192,14,0,0,0,56,192,0,0,0,0,28,192,0,0,0,0,15,192,0,0,0,0,3,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
};

const byte PROGMEM play_music[][288] = {

--the bitmap, I have removed some lines----
  {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,128,0,0,0,0,15,192,0,0,0,0,28,192,0,0,0,0,56,192,0,0,0,0,112,192,14,0,0,0,224,192,7,0,0,1,192,192,3,192,0,3,128,192,0,192,0,7,0,192,0,96,0,14,0,192,96,48,0,28,0,192,112,56,0,56,0,192,56,24,63,240,0,192,12,12,127,224,0,192,6,12,224,192,0,192,7,6,192,192,0,198,3,6,192,192,0,199,131,3,192,192,0,193,129,131,192,192,0,192,193,131,192,192,0,192,193,131,192,192,0,192,65,131,192,192,0,192,65,131,192,192,0,192,193,131,192,192,0,192,193,131,192,192,0,193,129,131,192,192,0,199,131,3,192,192,0,198,3,6,224,192,0,192,7,6,127,224,0,192,6,12,63,240,0,192,12,12,0,56,0,192,56,24,0,28,0,192,112,56,0,14,0,192,96,48,0,7,0,192,0,96,0,3,128,192,0,192,0,1,192,192,3,192,0,0,224,192,7,0,0,0,112,192,14,0,0,0,56,192,0,0,0,0,28,192,0,0,0,0,15,192,0,0,0,0,3,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
};

const byte PROGMEM reduce_vol[][288] = {

--the bitmap, I have removed some lines----
  {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,128,0,0,0,0,15,192,0,0,0,0,28,192,0,0,0,0,56,192,0,0,0,0,112,192,14,0,0,0,224,192,7,0,0,1,192,192,3,192,0,3,128,192,0,192,0,7,0,192,0,96,0,14,0,192,96,48,0,28,0,192,112,56,0,56,0,192,56,24,63,240,0,192,12,12,127,224,0,192,6,12,224,192,0,192,7,6,192,192,0,198,3,6,192,192,0,199,131,3,192,192,0,193,129,131,192,192,0,192,193,131,192,192,0,192,193,131,192,192,0,192,65,131,192,192,0,192,65,131,192,192,0,192,193,131,192,192,0,192,193,131,192,192,0,193,129,131,192,192,0,199,131,3,192,192,0,198,3,6,224,192,0,192,7,6,127,224,0,192,6,12,63,240,0,192,12,12,0,56,0,192,56,24,0,28,0,192,112,56,0,14,0,192,96,48,0,7,0,192,0,96,0,3,128,192,0,192,0,1,192,192,3,192,0,0,224,192,7,0,0,0,112,192,14,0,0,0,56,192,0,0,0,0,28,192,0,0,0,0,15,192,0,0,0,0,3,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
};

const byte PROGMEM increase_vol[][288] = {

--the bitmap, I have removed some lines----
  {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,128,0,0,0,0,15,192,0,0,0,0,28,192,0,0,0,0,56,192,0,0,0,0,112,192,14,0,0,0,224,192,7,0,0,1,192,192,3,192,0,3,128,192,0,192,0,7,0,192,0,96,0,14,0,192,96,48,0,28,0,192,112,56,0,56,0,192,56,24,63,240,0,192,12,12,127,224,0,192,6,12,224,192,0,192,7,6,192,192,0,198,3,6,192,192,0,199,131,3,192,192,0,193,129,131,192,192,0,192,193,131,192,192,0,192,193,131,192,192,0,192,65,131,192,192,0,192,65,131,192,192,0,192,193,131,192,192,0,192,193,131,192,192,0,193,129,131,192,192,0,199,131,3,192,192,0,198,3,6,224,192,0,192,7,6,127,224,0,192,6,12,63,240,0,192,12,12,0,56,0,192,56,24,0,28,0,192,112,56,0,14,0,192,96,48,0,7,0,192,0,96,0,3,128,192,0,192,0,1,192,192,3,192,0,0,224,192,7,0,0,0,112,192,14,0,0,0,56,192,0,0,0,0,28,192,0,0,0,0,15,192,0,0,0,0,3,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
};

const byte PROGMEM pause[][288] = {
 
  {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,248,31,240,0,0,15,248,31,240,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,8,24,24,16,0,0,15,248,31,240,0,0,15,248,31,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
};

const byte PROGMEM candado[][288] = {
  
  {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,240,0,0,0,0,63,252,0,0,0,0,112,14,0,0,0,0,224,7,0,0,0,1,128,1,128,0,0,3,128,1,192,0,0,3,0,0,192,0,0,6,0,0,96,0,0,6,0,0,96,0,0,6,0,0,96,0,0,4,0,0,32,0,0,12,0,0,48,0,0,12,0,0,48,0,0,12,0,0,48,0,0,12,0,0,48,0,0,12,0,0,48,0,0,255,255,255,255,0,3,255,255,255,255,192,3,0,0,0,0,192,3,0,0,0,0,192,3,0,0,0,0,192,3,0,0,0,0,192,3,0,0,0,0,192,3,0,0,0,0,192,3,0,0,0,0,192,3,0,0,0,0,192,3,0,3,192,0,192,3,0,7,224,0,192,3,0,7,224,0,192,3,0,7,224,0,192,3,0,3,192,0,192,3,0,3,192,0,192,3,0,3,192,0,192,3,0,3,192,0,192,3,0,3,192,0,192,3,0,0,0,0,192,3,0,0,0,0,192,3,0,0,0,0,192,3,0,0,0,0,192,3,0,0,0,0,192,3,0,0,0,0,192,3,0,0,0,0,192,3,0,0,0,0,192,3,255,255,255,255,192,1,255,255,255,255,128}
};

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.