adafruit / Adafruit_SSD1306

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

Updated support for 64x48 displays #188

Open dok-net opened 4 years ago

dok-net commented 4 years ago

Merges the support originally added in https://github.com/mcauser/Adafruit_SSD1306.git with the head of adafruit/Adafruit_SSD1306. The splash screen was adopted to mirror that of the other resolution displays. Relevant displays are for instance those for the Wemos/LOLIN D1 OLED shield.

@Misiu @ladyada @tablatronix @mcauser @MstrVLT This is the same as #136, that has received your attention before.

tokra commented 3 years ago

@dok-net I tried your code with my wemos d1 mini + 64x48 oled, and its not working properly: image

dok-net commented 3 years ago

@tokra I can confirm your findings for now. Will have to investigate which the fault occured, I'd like to believe it's some change in adafruit:master :-)

tokra commented 3 years ago

@dok-net i downloaded your latest branch changes and i got this:

/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp: In member function 'bool Adafruit_SSD1306::begin(uint8_t, uint8_t, bool, bool)':
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:544:46: error: expected '}' before ')' token
                                           0x0);                     // no offset
                                              ^
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:544:46: error: expected ',' or ';' before ')' token
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:553:38: error: expected ')' before '}' token
   ssd1306_command1(SSD1306_CHARGEPUMP}; // 0x8D
                                      ^
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:553:38: error: expected ';' before '}' token
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp: At global scope:
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:555:19: error: expected constructor, destructor, or type conversion before '(' token
   ssd1306_command1((vccstate == SSD1306_EXTERNALVCC) ? 0x10 : 0x14);
                   ^
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:561:22: error: expected constructor, destructor, or type conversion before '(' token
   ssd1306_commandList(init3, sizeof(init3));
                      ^
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:564:3: error: 'contrast' does not name a type
   contrast = 0x8F;
   ^
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:566:3: error: expected unqualified-id before 'if'
   if ((WIDTH == 128) && (HEIGHT == 32)) {
   ^
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:569:5: error: expected unqualified-id before 'else'
   } else if ((WIDTH == 128) && (HEIGHT == 64)) {
     ^
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:572:5: error: expected unqualified-id before 'else'
   } else if ((WIDTH == 96) && (HEIGHT == 16)) {
     ^
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:575:5: error: expected unqualified-id before 'else'
   } else if ((WIDTH == 64) && ((HEIGHT == 48) || (HEIGHT == 32))) {
     ^
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:578:5: error: expected unqualified-id before 'else'
   } else {
     ^
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:582:19: error: expected constructor, destructor, or type conversion before '(' token
   ssd1306_command1(SSD1306_SETCOMPINS);
                   ^
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:583:19: error: expected constructor, destructor, or type conversion before '(' token
   ssd1306_command1(comPins);
                   ^
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:584:19: error: expected constructor, destructor, or type conversion before '(' token
   ssd1306_command1(SSD1306_SETCONTRAST);
                   ^
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:585:19: error: expected constructor, destructor, or type conversion before '(' token
   ssd1306_command1(contrast);
                   ^
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:587:19: error: expected constructor, destructor, or type conversion before '(' token
   ssd1306_command1(SSD1306_SETPRECHARGE); // 0xd9
                   ^
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:588:19: error: expected constructor, destructor, or type conversion before '(' token
   ssd1306_command1((vccstate == SSD1306_EXTERNALVCC) ? 0x22 : 0xF1);
                   ^
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:596:22: error: expected constructor, destructor, or type conversion before '(' token
   ssd1306_commandList(init5, sizeof(init5));
                      ^
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:127:3: error: expected unqualified-id before 'if'
   if (wire) {                                                                  \
   ^
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:598:3: note: in expansion of macro 'TRANSACTION_END'
   TRANSACTION_END
   ^
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:129:5: error: expected unqualified-id before 'else'
   } else {                                                                     \
     ^
/Users/tokra/Documents/Arduino/libraries/Adafruit_SSD1306-esp8266-64x48/Adafruit_SSD1306.cpp:598:3: note: in expansion of macro 'TRANSACTION_END'
   TRANSACTION_END
   ^
exit status 1
Error compiling for board LOLIN(WEMOS) D1 R2 & mini.
tokra commented 3 years ago

@dok-net Tested, works great ! 🥳