Can someone help me with the following: I want to have a class containing a function and variable which are accessible from the cloud. But with the following code I get the error:
filename.ino:21:40: invalid use of non-static member function
The used code:
#include "application.h"
class example {
public:
example();
int var;
int set(String);
};
example::example() {
var = 0;
}
int example::set(String command) {
var = command.toInt();
}
example object;
void setup() {
Particle.function("set", object.set);
Particle.variable("var", object.var);
}
void loop() {
}
Thank you