Adafruit SSD1306 [SOLVED]

The Adafruit_SSD1306 library that can be found in Particle Build (Web IDE) does work for the display coming with the kit.

If building in Particle Build (Web IDE) you need to change the includes in the demos to

// e.g.  ssd1306-128x64-spi.ino

#include "Adafruit_SSD1306/Adafruit_GFX.h"
#include "Adafruit_SSD1306/Adafruit_SSD1306.h"

If building with Particle Dev or CLI just leave them as they are

For all IDEs do the wiring like this

// use hardware SPI
// OLED_D0 -> A3 (SPI CLK)
// OLED_D1 -> A5 (SPI MOSI)
#define OLED_DC     D3
#define OLED_CS     D4
#define OLED_RESET  D5

and you need to remove the function (which is some sort of residue of former firmware needs ;-))

int random(int maxRand) {
    return rand() % maxRand;
}
3 Likes