Send Float value from SLIDER in Dashboard to Arduino

Dear,

I am new to Cayenne and would like to send the data of a slider in the Dashboard that is a float value to my arduino.

CAYENNE_IN(VIRTUAL_CHANNEL)
{
int value = getValue.asInt();
Serial.print("Received from Cayenne : ");
Serial.println(value);
}

The code above works fine when I use a integer.
But I need to use a float.

CAYENNE_IN(VIRTUAL_CHANNEL)
{
float value = getValue.asFloat();
Serial.print("Received from Cayenne : ");
Serial.println(value);
}

DOESN’T WORK

Can you help me please ?

thanks

1 Like

try getValue.asDouble();

YES…it works !

Thanks a lot.

Best Regards,
Pascal

1 Like

Yes it Work…thank’s

1 Like