I have been using my Photons for day, and I have found a problem. My code will compile and flash, but whenever I call one of the cloud functions from my library the Photon crashes. I have included the tinker framework into my code, and it does not crash when one of its cloud functions is called.
In the .cpp file, I had to write the cloud functions like this to make it want to compile.
Spark.function("moveNeck", (int (*)(String))&sparkbot::moveNeckCloud); Spark.function("moveRight", (int (*)(String))&sparkbot::moveRightCloud); Spark.function("moveLeft", (int (*)(String))&sparkbot::moveLeftCloud); Spark.function("moodlights", (int (*)(String))&sparkbot::moodlightsCloud); Spark.function("enableSlave", (int (*)(String))&sparkbot::slaveToggle);
In the .h file, they are defined as:
int moveNeckCloud(String data); int moveRightCloud(String data); int moveLeftCloud(String data); int moodlightsCloud(String red, String green, String blue); int slaveToggle(String data);
I don’t know why this is happening. It’s probably something to do with the rest of my code. If anyone wants to create a pull request, here is the Github Link.