Getting started with Photon Maker Kit totally confused

I could not agree more with cr_huber. I think the Photon will be a great thing to play with but my initial experience has been very frustrating. I have a lot of experience with Arduinos, Python and C++. I’m not a progressional by any means but I’m not a newby either. As a consumer, when I buy a “Maker kit” I expect a tiny bit of help. I have no experience with OLED screens so I thought that it would be fun to place to start. The Maker kit came with no instructions - either in the box or on the web. The starter book (Getting Started with the Photon $20) doesn’t mention OLED displays or even I2C or SPI for that matter - shocking really. The data sheet for the OLED display on the Particle.io site is in Chinese (https://docs.particle.io/assets/datasheets/makerkit/oled.pdf). While one day I hope to be able to read Chinese, the data sheet was of little help to me now.

I thought perhaps that the example program in the Web IDE would be a good place to start. It would have been nice to see a simple table of how to connect the seven wires. Complicating matters, I think the example was written for an Arduino. I can’t tell you how many tutorials I searched through trying to find an example of pin outs. (The number of pins varies from four to eleven on different models and, on those with seven pins, the labels can be quite different: [GND VCC D0 D1 RST DC CS] vs [CS RST D/C CLK DATA VIN 3.3V GND] vs [Data CLK SA0 RST CS 3V3 VIN GND].

I’m not complaining that there is such a wonderful variety of very cool OLED displays - I’m just pointing out how much time one can spend trying to sort this out - given that the Maker kit provides absolutely zero information.

Based on another thread (Adafruit SSD1306 [Solved) I decided to go with SPI and the following wiring:
OLED - Photon
GND GND
VCC 3V3
D0 A3 // OLED_D0 -> A3 (SPI_SCK)
D1 A5 // OLED_D1 -> A5 (SPI_MOSI)
RST D5 // OLED_RESET -> D5
DC D3 // OLED_DC -> D3
CS D4 // OLED_CS -> D4

(The Photon documentation shows that the SPI1 functions are exposed on the following: SPI1_SS:A2, SPI1_SCK: A3, SPI1_MISO: A4, SPI3_MOSI: A5 - so I don’t quite understand why the above wiring should work but perhaps that is grist for the SPI tutorial mill).

Using the example provided in the Particle Web IDE (ssd1306_128x64_spi) and including the libraries ADAFRUIT_SSD1306 and ADAFRUIT_GFX, I get the following errors:

ssd1306_128x64_spi.cpp:74:2: error: #error ("Height incorrect, please fix Adafruit_SSD1306.h!");
   0B00000001, 0B11000000,
  ^
ssd1306_128x64_spi.cpp:40:1: error: 'Adafruit_SSD1306' does not name a type
 #include "Adafruit_GFX.h"
 ^ 
ssd1306_128x64_spi.cpp: In function 'void setup()':
ssd1306_128x64_spi.cpp:81:3: error: 'display' was not declared in this scope
   0B00011111, 0B11111100,
   ^
ssd1306_128x64_spi.cpp:81:17: error: 'SSD1306_SWITCHCAPVCC' was not declared in this scope
   0B00011111, 0B11111100,
                 ^
ssd1306_128x64_spi.cpp:89:29: error: 'WHITE' was not declared in this scope
                             ^
ssd1306_128x64_spi.cpp:156:24: error: 'BLACK' was not declared in this scope
                        ^
ssd1306_128x64_spi.cpp: In function 'void testdrawbitmap(const uint8_t*, uint8_t, uint8_t)':
ssd1306_128x64_spi.cpp:190:29: error: 'display' was not declared in this scope
   delay(1000); 
                             ^
ssd1306_128x64_spi.cpp:205:7: error: 'display' was not declared in this scope
   // initialize
       ^
ssd1306_128x64_spi.cpp:205:81: error: 'WHITE' was not declared in this scope
   // initialize
                                                                                 ^
ssd1306_128x64_spi.cpp:207:5: error: 'display' was not declared in this scope
     icons[f][XPOS] = random(display.width());
     ^
ssd1306_128x64_spi.cpp:212:82: error: 'BLACK' was not declared in this scope
     Serial.print(icons[f][XPOS], DEC);
                                                                                  ^
ssd1306_128x64_spi.cpp: In function 'void testdrawchar()':
ssd1306_128x64_spi.cpp:227:3: error: 'display' was not declared in this scope
     // then erase it + move it
   ^
ssd1306_128x64_spi.cpp:228:24: error: 'WHITE' was not declared in this scope
     for (uint8_t f=0; f< NUMFLAKES; f++) {
                        ^
ssd1306_128x64_spi.cpp: In function 'void testdrawcircle()':
ssd1306_128x64_spi.cpp:241:23: error: 'display' was not declared in this scope
                       ^
ssd1306_128x64_spi.cpp:242:66: error: 'WHITE' was not declared in this scope
                                                                  ^
ssd1306_128x64_spi.cpp: In function 'void testfillrect()':
ssd1306_128x64_spi.cpp:249:23: error: 'display' was not declared in this scope
     if (i == '\n') continue;
                       ^
ssd1306_128x64_spi.cpp: In function 'void testdrawtriangle()':
ssd1306_128x64_spi.cpp:258:27: error: 'display' was not declared in this scope
   for (int16_t i=0; i<display.height(); i+=2) {
                           ^
ssd1306_128x64_spi.cpp:261:65: error: 'WHITE' was not declared in this scope
   }
                                                                 ^
ssd1306_128x64_spi.cpp: In function 'void testfilltriangle()':
ssd1306_128x64_spi.cpp:267:19: error: 'WHITE' was not declared in this scope
     // alternate colors
                   ^
ssd1306_128x64_spi.cpp:268:22: error: 'display' was not declared in this scope
     display.fillRect(i, i, display.width()-i*2, display.height()-i*2, color%2);
                      ^
ssd1306_128x64_spi.cpp:272:33: error: 'BLACK' was not declared in this scope
 }
                                 ^
ssd1306_128x64_spi.cpp: In function 'void testdrawroundrect()':
ssd1306_128x64_spi.cpp:279:23: error: 'display' was not declared in this scope
     display.display();
                       ^
ssd1306_128x64_spi.cpp:280:96: error: 'WHITE' was not declared in this scope
   }
                                                                                                ^
ssd1306_128x64_spi.cpp: In function 'void testfillroundrect()':
ssd1306_128x64_spi.cpp:286:19: error: 'WHITE' was not declared in this scope
     display.fillTriangle(display.width()/2, display.height()/2-i,
                   ^
ssd1306_128x64_spi.cpp:287:23: error: 'display' was not declared in this scope
                      display.width()/2-i, display.height()/2+i,
                       ^
ssd1306_128x64_spi.cpp:289:33: error: 'BLACK' was not declared in this scope
     if (color == WHITE) color = BLACK;
                                 ^
ssd1306_128x64_spi.cpp: In function 'void testdrawrect()':
ssd1306_128x64_spi.cpp:296:23: error: 'display' was not declared in this scope
   for (int16_t i=0; i<display.height()/2-2; i+=2) {
                       ^
ssd1306_128x64_spi.cpp:297:71: error: 'WHITE' was not declared in this scope
     display.drawRoundRect(i, i, display.width()-2*i, display.height()-2*i, display.height()/4, WHITE);
                                                                       ^
ssd1306_128x64_spi.cpp: In function 'void testdrawline()':
ssd1306_128x64_spi.cpp:303:23: error: 'display' was not declared in this scope
   uint8_t color = WHITE;
                       ^
ssd1306_128x64_spi.cpp:304:51: error: 'WHITE' was not declared in this scope
   for (int16_t i=0; i<display.height()/2-2; i+=2) {
                                                   ^
ssd1306_128x64_spi.cpp:307:23: error: 'display' was not declared in this scope
     else color = WHITE;
                       ^
ssd1306_128x64_spi.cpp:308:50: error: 'WHITE' was not declared in this scope
     display.display();
                                                  ^
ssd1306_128x64_spi.cpp:313:3: error: 'display' was not declared in this scope
   for (int16_t i=0; i<display.height()/2; i+=2) {
   ^
ssd1306_128x64_spi.cpp:315:51: error: 'WHITE' was not declared in this scope
     display.display();
                                                   ^
ssd1306_128x64_spi.cpp:319:67: error: 'WHITE' was not declared in this scope
 void testdrawline() {  
                                                                   ^
ssd1306_128x64_spi.cpp:326:67: error: 'WHITE' was not declared in this scope
     display.display();
                                                                   ^
ssd1306_128x64_spi.cpp:330:67: error: 'WHITE' was not declared in this scope
   display.clearDisplay();
                                                                   ^
ssd1306_128x64_spi.cpp:337:50: error: 'WHITE' was not declared in this scope
     display.display();
                                                  ^
ssd1306_128x64_spi.cpp:341:67: error: 'WHITE' was not declared in this scope
   display.clearDisplay();
                                                                   ^
ssd1306_128x64_spi.cpp: In function 'void testscrolltext()':
ssd1306_128x64_spi.cpp:348:3: error: 'display' was not declared in this scope
     display.display();
   ^
ssd1306_128x64_spi.cpp:349:24: error: 'WHITE' was not declared in this scope
   }
                        ^
make[1]: *** [../build/target/user/platform-6ssd1306_128x64_spi.o] Error 1
make: *** [user] Error 2
Error: Could not compile. Please review your code.

Others have apparently gotten the same error(s) and the discussion https://community.particle.io/t/adafruit-ssd1306-library-ported/3505/75 seems to center on the problems of porting libraries and the benefits of abandoning the Particle Web IDE for the Spark DEV.

Is there another solution?

I am quite prepared to do my homework and I look forward to the leaning process. But I question whether selling kits without a “hello world” example is a good business model for Particle.io

1 Like