Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void callback(char* topic, byte* payload, unsigned int length) {
- for (int i=0;i<length;i++) {
- payload[length] = '\0';
- cstring = (char *) payload;
- }
- // Serial.println(topic); //This is the topic
- // Serial.println(cstring); //this is the payload
- request = atof(cstring);
- if (strstr(topic, "setpoint") != NULL) {
- for (unsigned i = 0; i < sizeof(sensor_list) / sizeof(Sensor); i++) {
- char row = i;
- if (strstr(topic, row) != NULL) {
- setpoint = atof(cstring);
- sensor_list[i].setpoint = setpoint;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement