Problems with the .h file in libraries or maybe just the ADAFRUIT_ILI9341 library

Sorry if I hurt your feelings, but when coining a term like this you imply that you must have encountered lots of unreliabilities that long term users don't see.

And when you say

You are actually not signalling that you had read the docs but rather the opposite.

But the starting misunderstandings aside, I'd like to help you to get started.
So I'll have a look at these two libraries.

Stay tuned and sorry again ...

Edit:
I've tried building a test sketch using both libs and it does fine without errors.
Could you provide your code, to see what's wrong then?

Does your Particle Build really display your project like this?

1 Like

ScruffR, I appreciate the help. Sorry we got off on a bad step.

My build looks like this. I was just trying to get started, but i couldn’t even get the libraries to verify.

Thanks for your help.

That’s very odd as it works for me, so my next guess would be to check the device and firmware version you are targetting with Build.

You could also try adding a blank line at the top (don’t ask :confused:)

Or

#pragma SPARK_NO_PREPROCESSOR
#include "application.h"

at the top.

ScruffR
The blank line seemed to help. (strange)

I also added the application.h library in place of the older wire.h. That seemed to help too. I had seen that in one of you previous post on “porting”.

Thanks

1 Like

The blank line also has to do with the preprocessor playing up (sometimes with sometimes without the blank line)

Having said this, before getting to know all the “perks” of the system you might actually feel the tools are unreliable, where they are only fuzzy :wink:

1 Like

I'm seeing the same warning / problem when trying to get the Blynk library to blink an LED within the app when I push a physical button on the Particle. The weird thing is -- everything works fine if I inline the "toggleLed" function, so I'm not sure if my C++ passing by reference semantics are to blame.

Can you please take a look? I think my next stops might need to by the Blynk forums / github, unless you can see something obviously wrong with my code:

//#pragma SPARK_NO_PREPROCESSOR
//#include "application.h"
#include "clickButton/clickButton.h"
#include "blynk/blynk.h"

//Class WidgetLED; //pre-defining didn't work

char auth[] = "12345etc";

ClickButton b1(A0);
WidgetLED led1(V0);
//void toggleLed(WidgetLED&);

void toggleLed(const WidgetLED& myled) {
    if(myled.getValue()) {
        myled.off();
    } else {
        myled.on();
    }
}

void setup() {
    pinMode(A0, INPUT_PULLUP);
    delay(1000);
    Blynk.begin(auth);
}

void loop() {
    Blynk.run();
    if (b1.clicks > 0) toggleLed(&led1);
}

The error I see when verifying is:

In file included from blynk/BlynkParticle.h:16:0,
from blynk/BlynkSimpleParticle.h:14,
from blynk/blynk.h:2,
from blynk_test.cpp:5:
blynk/BlynkApiParticle.h:78:6: warning: #warning "analogInputToDigitalPin not defined => Named analog pins will not work" [-Wcpp]
#warning "analogInputToDigitalPin not defined => Named analog pins will not work"
^
blynk_test.cpp: In function 'void toggleLed(const WidgetLED&)':
blynk_test.cpp:17:19: error: passing 'const WidgetLED' as 'this' argument of 'void WidgetLED::off()' discards qualifiers [-fpermissive]
myled.off();
^

blynk_test.cpp:19:18: error: passing 'const WidgetLED' as 'this' argument of 'void WidgetLED::on()' discards qualifiers [-fpermissive]
myled.on();
^

blynk_test.cpp: In function 'void loop()':
blynk_test.cpp:31:39: error: invalid user-defined conversion from 'WidgetLED*' to 'const WidgetLED&' [-fpermissive]
if (b1.clicks > 0) toggleLed(&led1);
^

In file included from blynk/BlynkWidgets.h:10:0,
from blynk/BlynkSimpleParticle.h:19,
from blynk/blynk.h:2,
from blynk_test.cpp:5:
blynk/WidgetLED.h:18:2: note: candidate is: WidgetLED::WidgetLED(uint8_t)
WidgetLED(uint8_t pin) : mPin(pin) {}
^
blynk/WidgetLED.h:18:2: note: no known conversion for argument 1 from 'WidgetLED*' to 'uint8_t {aka unsigned char}'
blynk_test.cpp:31:39: error: invalid conversion from 'WidgetLED*' to 'uint8_t {aka unsigned char}' [-fpermissive]
if (b1.clicks > 0) toggleLed(&led1);
^

In file included from blynk/BlynkWidgets.h:10:0,
from blynk/BlynkSimpleParticle.h:19,
from blynk/blynk.h:2,
from blynk_test.cpp:5:
This looks like an error in blynk library. Would you like to create an issue on GitHub to let the author know?
CREATE ISSUE
blynk/WidgetLED.h:18:2: error: initializing argument 1 of 'WidgetLED::WidgetLED(uint8_t)' [-fpermissive]
WidgetLED(uint8_t pin) : mPin(pin) {}
^

make[1]: *** [../build/target/user/platform-6blynk_test.o] Error 1
make: *** [user] Error 2
Error: Could not compile. Please review your code.

Is there something about the definition of this class that prevents passing instance references of it to a function? Or (more likely probably) am I doing it wrong? Thank you for your help.

Edit: "Works fine when the function is inlined" just means that it compiles and uploads to the photon. Still can't get Blynk LED widget to light up in the app when I click a button attached to the Photon.

Try not passing the pointer but the reference, by removing the ampersand (&) from that line.