[SOLVED] Nodemcu Ubidots::add from variable


#1

I have a simple code:

float tempC = getTemperature(i);
String api = GetAddressToString(devAddr[i]);

client.add(api, tempC);

When I run a check, I get the following message:

no matching function for call to 'Ubidots::add(String&, float&)'

What kind of variable type should I use in this case? When I type static label

client.add("Temp1", tempC)

the code is working fine. How can i write a dynamic code?

Thanks!


#2

Greetings dear user, from the error reported by you i see that you are trying to add an String object instead of a char array, the add() accepts only char arrays as first parameters so you should cast your String to Char type.

Regards


#3

Thank you! I don’t know this restriction.