WaveShare 1.5 inch RGB OLED with SPI on Argon invalid conversion from 'uint16_t'

Has anyone successfully implemented a WaveShare 1.5 inch OLED with SPI on an Argon? I tried using the “Adafruit_SSD1351_Photon.h” library, but I get multiple instances of this error when trying to compile (even with just the library included and no other code):

lib/Adafruit_SSD1351_Photon/Adafruit_SSD1351_Photon.cpp:175:13: invalid conversion from ‘uint16_t’ {aka ‘short unsigned int’} to ‘particle::Error::Type’ [-fpermissive]

Have you tried fixing the error?

Maybe @nfriedly, who contributed that library, can have a look at it and maybe push a fix.

Sorry, guys. I started over and reloaded the libraries and sample code and it seems to be working now. Thanks for your response. Happy 2021!

1 Like

Oh, cool! I haven’t thought about that library in a while. Glad to hear it’s still working after a fresh start.

1 Like

I have precisely the same problem but have not been able to resolve it.

When I compile the Adafruit_SSD1352_Photon library, I receive the following error:

"lib/Adafruit_SSD1351_Photon/Adafruit_SSD1351_Photon.cpp:175:13: invalid conversion from 'uint16_t' {aka 'short unsigned int'} to 'particle::Error::Type' [-fpermissive]"

This occurs even when compiling with an empty *.ino file.
The offending code is in the first call to swap (see below).

void Adafruit_SSD1351::fillRect(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t fillcolor) {
  // Transform x and y based on current rotation.
  switch (getRotation()) {
  case 0:  // No rotation
    rawFillRect(x, y, w, h, fillcolor);
  case 1:  // Rotated 90 degrees clockwise.
    swap(x, y);
    x = WIDTH - x - h;
    rawFillRect(x, y, h, w, fillcolor);
  case 2:  // Rotated 180 degrees clockwise.
    x = WIDTH - x - w;
    y = HEIGHT - y - h;
    rawFillRect(x, y, w, h, fillcolor);
  case 3:  // Rotated 270 degrees clockwise.
    swap(x, y);
    y = HEIGHT - y - w;
    rawFillRect(x, y, h, w, fillcolor);

I have tried reloading the libraries, but the error remains.

Any one have a suggestion?

Thanks so much - David

Just an update: I can get the code to compile when using the MacOS Visual Studio/Particle Workbench; it does not compile (due to the errors above) when using the Particle Web IDE.

Very strange.

If you can provide a SHARE THIS REVISION link to your Web IDE project we can have a look.


Thanks so much!

Actually, the which does not compile in the Web IDE code is this simple:

// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_mfGFX.h>

// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_SSD1351_Photon.h>

void setup() {
void loop() {

Builds fine for me tho’

So does the library example

Hence the issue must me with your setup/project.
What device and device OS version are you targeting?
Have you tried what the OP did to solve his own problem?

BTW, the 1351 library already features a mfGFX reference, so don’t need to import that yourself.

@nfriedly, would you happen to have a GitHub repo for that library and if so, could you push a updated version of the library.properties file that also features a url and repository entry? That would be great.

I was only ever able to get it to compile in the workbench, not the web IDE.

Since it obviously works for me (Argon @ v2.0.1) the question is: What’s different? :wink:

Well, I’m using MacOS Big Sur. It’s caused me a lot of grief with other software.

However, since this is a web-based IDE AND my code compile on the local workbench, I’m not sure I can blame things on Apple. This time.

Thanks for the tip about the 1351 library. But I just tried compiling without the #include mfGFX reference in my (empty) code, and received a compilation error.

I guess I’ll stick with the local workbench for now.

Still no answer to this?

Done: Adafruit_SSD1351_Photon/library.properties at master · nfriedly/Adafruit_SSD1351_Photon · GitHub

It’s been so long since I’ve touched this that I don’t remember now - will the Particle automatically pick up that change or do I need to do something else besides updating the code on github?

1 Like

Default OS: 2.0.1

You’d need to nudge up the version number in library.properties and would need to run these two commands from the directory where you got the library stored

particle library upload
particle library publish

BTW, while at it you could also nudge up the dependency to


As I said builds for me fine - on the Photon @ 2.0.1 too

Try building this sample

That compiled perfectly!

What is the difference?

Thanks so much - David

Hard to say, I have no failing project so I can’t tell :wink: