Mar 17, 2015

why is OLED display scrambled (random pixels)?

"...and it was just working a little while ago!"

Turns out it's probably not the display, nor the computer, nor the power.

It's the pin for the RESET line. In transferring from library to my working code, I omitted to re-edit the definition of the reset pin. If it's not working, check that RST is wired to the correct pin, and that it is set for output. The reset is necessary for both the SPI and and I2C versions with the Adafruit library.

// ... Monochrome OLEDs based on SSD1306 drivers

#include
#include
#include

#define OLED_RESET 2    // 4 (is the default in the example code)
Adafruit_SSD1306 display(OLED_RESET);