Sending an EXACT value to rduino via Cayenne


#1

I’m trying to send a value (integer value, range 0-500) to my arduino via the Cayenne dashboard using the slider.

I have it working as in it sends data to a virtual pin, but the integer value is not exactly what was set via the slider.

ie set the slider to “250” and the value received at the arduino may be 245768. I can easily deal with the extra digits by dividing by 1000 but it still wont “round” to the 250 I require. Also its hard to get an exact figure on the slider if the scale is too large.

What I am trying to do is set a target distance to acquire and I need to be able to set this to single digit precision in the 0-500 range.
Or is there a better way to send this data to the arduino via Cayenne?

PS - can you please also offer “cm” as a distance value in the distance widget not just inches? :wink:


Arduino RCSwitch Libary + Send Variable
#2

Seeing some weird stuff here too, going to have to take a look at getValue.asInt()


#3

For now just use int currentValue = getValue.asInt()/1023; and you’ll get the exact number. This is definitely a bug but I couldn’t find exactly where it is in the .h include labyrinth.


#4

Cheers - I now realise it was getStr() that was giving me the 255750 for a slider value of 250

getInt() gives me -6394!

Ran with the getDouble() option and the /1023 and get what i need for now but please look into it further :slight_smile: