The Mesh.subscribe() and Mesh.publish() functions send and receive data as const char. Any tips on converting that to float, int, etc. for calculation?
Example syntax:
void myHandler(const char *event, const char *data)
{
Serial.printlnf("event=%s data=%s", event, data ? data : "NULL");
//would like to cast / convert to float to do maths...tried float variable = data.toFloat() but got compiler errors.
}
void setup()
{
Serial.begin(9600);
Mesh.subscribe("motion-sensor", myHandler);
}