datasith / Ai_Ardulib_SSD1306

Library for using SSD1306-powered OLED displays in the Arduino IDE.
MIT License
56 stars 22 forks source link

Example compilation error #1

Closed AndKe closed 6 years ago

AndKe commented 7 years ago

Build options changed, rebuilding all
In file included from /home/andre/Arduino/arduino-1.8.0/hardware/arduino/avr/cores/arduino/Arduino.h:28:0,
                 from sketch/HelloString.ino.cpp:1:
/home/andre/Arduino/projects/libraries/ACROBOTIC_SSD1306/fonts/font5x7.h:7:19: error: redefinition of 'const uint8_t _n []'
 OLEDFONT(font5x7) PROGMEM =
                   ^
In file included from /home/andre/Arduino/projects/libraries/ACROBOTIC_SSD1306/examples/HelloString/HelloString.ino:22:0:
/home/andre/Arduino/projects/libraries/ACROBOTIC_SSD1306/ACROBOTIC_SSD1306.h:32:72: note: 'const uint8_t _n [762]' previously defined here
   #define OLEDFONT(name) static const uint8_t __attribute__ ((progmem))_n[]
                                                                        ^
/home/andre/Arduino/projects/libraries/ACROBOTIC_SSD1306/fonts/font8x8.h:7:1: note: in expansion of macro 'OLEDFONT'
 OLEDFONT(font8x8) PROGMEM =
 ^
/home/andre/Arduino/projects/libraries/ACROBOTIC_SSD1306/examples/HelloString/HelloString.ino: In function 'void setup()':
HelloString:28: error: 'font5x7' was not declared in this scope
   oled.setFont(font5x7);            // Set font type (default 8x8)
                ^
exit status 1
'font5x7' was not declared in this scope
Ariffffff commented 7 years ago

same here

shuliga commented 7 years ago

Mistake in file ACROBOTIC_SSD1306.h Fix: line 32: #define OLEDFONT(name) static const uint8_t __attribute__ ((progmem)) _n[] change to: #define OLEDFONT(name) static const uint8_t __attribute__ ((progmem)) name[]

prankard commented 7 years ago

Thanks @shuliga I've just added a pull request with this fix

datasith commented 6 years ago

Done!