bug in adafruit 1306

Please help on this issue

I found an error while compile adafruit 1306 example ,

./opt/arduino-builder/arduino-builder -compile -core-api-version 10611 -build-path /tmp/195882165/build -hardware opt/arduino-builder/hardware -hardware ./opt/cores -tools opt/arduino-builder/tools -tools ./opt/tools -built-in-libraries opt/libraries/latest -libraries /tmp/195882165/pinned -libraries /tmp/195882165/custom -fqbn arduino:avr:uno -build-cache /tmp -logger humantags -verbose=false /tmp/195882165/ssd1306_128x64_i2c

Multiple libraries were found for "Adafruit_SSD1306.h"

Used: /home/ubuntu/opt/libraries/latest/adafruit_ssd1306_wemos_mini_oled_1_1_2

Not used: /home/ubuntu/opt/libraries/latest/adafruit_ssd1306_1_1_2

/tmp/195882165/ssd1306_128x64_i2c/ssd1306_128x64_i2c.ino:54:2: error: #error ("Height incorrect, please fix Adafruit_SSD1306.h!");

#error("Height incorrect, please fix Adafruit_SSD1306.h!");

^

exit status 1

It's not actually a bug, it's just that the library is configured by default for a 128x32 display and you need to modify the library to support 128x64.

Do this:

//   #define SSD1306_128_64
   #define SSD1306_128_32

to:

  #define SSD1306_128_64
//   #define SSD1306_128_32
  • Save the file.
  • Zip the Adafruit_SSD1306-1.1.2 folder
  • (In the Arduino Web Editor) Click the "Libraries" tab on the left side of the screen.
  • Click the up arrow icon (Import library)
  • If you get a notification telling you that you can import your sketchbook, click "Import"
  • Select the file Adafruit_SSD1306-1.1.2.zip
  • Click "Open"
  • Wait until you see the notification "Libraries successfully imported: Adafruit_SSD1306-1.1.2".
  • Click "OK"

After doing that you should be able to compile the ssd1306_128x64_i2c example.