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]
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);
break;
case 1: // Rotated 90 degrees clockwise.
swap(x, y);
x = WIDTH - x - h;
rawFillRect(x, y, h, w, fillcolor);
break;
case 2: // Rotated 180 degrees clockwise.
x = WIDTH - x - w;
y = HEIGHT - y - h;
rawFillRect(x, y, w, h, fillcolor);
break;
case 3: // Rotated 270 degrees clockwise.
swap(x, y);
y = HEIGHT - y - w;
rawFillRect(x, y, h, w, fillcolor);
break;
}
}
I have tried reloading the libraries, but the error remains.
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.
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() {
}
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.
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.
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?
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