Hi,
I can successfully get webhook data with handler, but i want that data inside loop() not in handler function.
How can i get the data(priceData in code) to use it inside loop?
void setup() {
Particle.subscribe("hook-response/price", priceData, MY_DEVICES);
}
void loop() {
String data = String(10);
// Trigger the integration
bool success = Particle.publish("triggerPrice", data, PRIVATE);
}
void priceData(const char *event, const char *data) {
int price = atof(data);
//price is 2500
}