bug in adafruit 1306

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.