The Particle Maker Kit comes with a cool little monochromatic 0.96" OLED screen but the one I received didn’t match any documentation online. It didn’t even have a model number on the PCB! If you find yourself in the same situation, this post will help you get up and running quickly.
My OLED came on a breakout board with 7 pins. Wire them as follows for Software SPI control:
OLED <-> Photon
CS <-> D3
DC <-> D2
RST <-> D4
D1 <-> D0
D0 <-> D1
VCC <-> 3V3
GND <-> GND
Next, the demo code for the Adafruit SSD1306 needs some tweaking.
First, find the two #include lines at the top of the file:
#include "Adafruit_GFX.h"
#include "Adafruit_SSD1306.h"
Change them to this:
#include "Adafruit_SSD1306/Adafruit_GFX.h"
#include "Adafruit_SSD1306/Adafruit_SSD1306.h"
Next, comment out the hardware SPI config block and uncomment the software SPI block like so:
// software SPI:
#define OLED_MOSI D0
#define OLED_CLK D1
#define OLED_DC D2
#define OLED_CS D3
#define OLED_RESET D4
Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);
/*
// hardware SPI
#define OLED_DC D3
#define OLED_CS D4
#define OLED_RESET D5
Adafruit_SSD1306 display(OLED_DC, OLED_RESET, OLED_CS);
*/
Finally, comment out the entire random() function declaration:
int random(int maxRand) {
return rand() % maxRand;
}
At this point, your code should compile and you can deploy the demo! Good luck!