With the help of this great community (especially @peekay123 – thanks!) I was able to build my first Photon demo that I would like to share with you. It is a mashup of some code and libraries I have taken from different posts in this forum and external sources. I tried to document this where possible.
Demo project on Github
- Photon – SparkFun Photon RedBoard
- Adafruit OLED Breakout Board - 16-bit Color 1.5" w/microSD holder
Libraries and code
- Adafruit mfGFX and SSD1351 Library
with rotation support from https://github.com/mikeseeh/Adafruit_SSD1351_Library
- bmpDraw Code
OLED Photon SI A5 CL A3 DC D7 R D5 OC D6 SC A2 SO A4 CD none 3V none + 3.3v G GND
Image on SD Card
The image displayed on the screen gets loaded from the SD card. Place it as logo.bmp on the card or change the name in line #102. The file format must be BMP with 24bit.
- I use the Particle Dev to compile the code in the cloud and push it on the Photon. You can use a local folder structure as long as you don’t refer to it in the #include statements (so only use the .h filenames).
- In the code I found online I could not use the bmpDraw function as the declarations of read16 and read32 were missing. These are added in the line 69 and 70.
- Be sure to not mix hardware and software SPI. I had this problem …
Have fun and get in contact if you have questions!