Adafruit OLED SSD1351 libraries

Does anybody have access to the Adafruit OLED SSD1351 libraries ported to Spark?


@pteja, it seems I did a port some time ago. You can find the files on my github here. Being an older port, it may need some tweaks to compile with the latest version of the firmware. Let me know how it goes. :smile:

Thanks @peekay123 - found the libs in your Github repository.

I am compiling locally. While compiling, the file “TFTLCD.cpp” is giving errors as the compiler is unable to find the variables defined in “TFTLCD.h”. Weird!!

@pteja, there is no file TFTLCD.cpp in the repo link I gave you! Did you use THIS repo?

@peekay123 The TFTLCD.cpp is from this repo.


I think I made a mess / mesh of files from different repos :frowning:

Just to be extra sure - I am using this Adafruit display.

Here are the hardware connections:

Display Pin        Spark Pin
G                      GND
+                      +5V
3V                     NC
CD                     NC
SD                     A4
SC                     D5
OC                     D6
R                      A2
DC                     D7
CL                     A3
SI                     A5

@peekay123 - could you please send me instruction on how to compile this repo. First I want to get only the display working.

In the repo there is the file test.ino. Isn’t that for Arduino? How can I use it to test the display with Spark core?

@pteja, first I think your wiring is incorrect. Let’s stick to the display wiring and not worry about he SD portion:

 Display Pin        Spark Pin
G                      GND
+                      +5V
3V                     NC
CD                     NC
SO/MISO                A4
SC/SCS                 A2
OC/OCS                 D6
R/RST                  D5
DC                     D7
CL/SCLK                A3
SI/MOSI                A5

This assume you use hardware SPI and A2 (SC/SCS) is used as the chipselect. You need to use my github repo for the library and I STRONGLY suggest you load and use Spark CLI to compile your code. :smile:

Thanks @peekay123.

  1. Changed the wiring as suggested.
  2. Downloaded the 3 zipped files directly from the Spark’s GitHub website and put them on a local folder (Mac):
  3. Added the all *.cpp files from this repo to the core-firmware/src folder
  4. Added all the *.h files from this repo to the core-firmware/inc folder
  5. Renamed test.ino file to application.cpp and copied it to the core-firmware/src folder
  6. Executed make command on the terminal from the core-firmware/build folder
  7. Flashed the resulting core-firmware.bin to the Spark core. Core breathing cyan.

Expected: To see test text on display.

Result: No output on display.

Help! :smile:

Just realized that I compiled with an older application.cpp!!

When compiling with test.ino renamed as application.cpp, I get the following errors (and lost of similar ones):

../src/application.cpp: In function 'void setup()':
../src/application.cpp:80:18: error: 'lcdTestPattern' was not declared in this scope
../src/application.cpp:89:390: error: 'testdrawtext' was not declared in this scope
   testdrawtext("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a tortor imperdiet posuere. ", WHITE);
../src/application.cpp:93:16: error: 'tftPrintTest' was not declared in this scope
../src/application.cpp:101:19: error: 'testlines' was not declared in this scope
../src/application.cpp:105:26: error: 'testfastlines' was not declared in this scope
   testfastlines(RED, BLUE);
../src/application.cpp:109:22: error: 'testdrawrects' was not declared in this scope

So I guess renaming test.ino to application.cpp is not a good idea. How can I test the display?

I got the display working by now. @peekay123: your library works without any problems. Many thanks!

1 Like

This library no longer works, due to the PIN_MAP issue. I am not a good enough programmer to fix it. Peekay123, any chance you could do a quick fix so that it works with Photons? I’m doing a project for my work, and I’m about to give up because it’s so hard to get libraries to work properly.