Hello everyone.
I have been attempting to control neopixels through cloud data (specifically Google Sheets). This has brought me to the intergration ‘Webhook’. This seems to correctly connect my Particle Photon to the cloud, however where I get stuck is how to convert the incoming data into something that I can use.
#include "Particle.h"
void setup() {
// Subscribe to the integration response event
Particle.subscribe("hook-response/Steps", myHandler, MY_DEVICES);
}
void loop() {
// Get some data
String data = String(10);
// Trigger the integration
Particle.publish("Steps", data, PRIVATE);
// Wait 6 seconds
delay(6000);
}
void myHandler(const char *event, const char *data) {
char StepsT=atoi(data);
}
This gives the following output into my console:
{“columns”:{"_cn6ca":[600,40,64,350,251,249,3000,5,23,750]},“rows”:[{"_cn6ca":600},{"_cn6ca":40},{"_cn6ca":64},{"_cn6ca":350},{"_cn6ca":251},{"_cn6ca":249},{"_cn6ca":3000},{"_cn6ca":5},{"_cn6ca":23},{"_cn6ca":750}]}
If I want to use these values 600,40,64,350,251,249,3000,5,23,750 how do I call these individual values in my code? I believe they are stored in the variable *data, but I am unable to figure out how to filter this variable into useable subvariables.
Thanks a lot in advance for helping me!