Arduino Model: Arduino Uno with Ethernet Shield (W5100)
Issue Description
The slider widget is not producing the correct values.
When the Slider is at a position which “displays” a value of 1.0, the actual value being sent to the Arduino is a value of 1023.
Actual value = Displayed value x 1023
Let me show you:
First - we have to create a slider widget (as per the picture below)
Please note - that I am using Virtual pin 0 (V0) to record the value of the slider within the Arduino sketch. Also note that I want the slider to have a range from 0 to 1023, as per the screenshot above.
Once added, it should look like this:
And if I slide it to the maximum value of 1023, it should look like this:
Ok - all good so far.
So now let us retrieve the value of the slider, by assigning the slider “value” to Virtual Pin 1 (V1).
We will display that value on the dashboard next to the slider.
Thanks for posting this. We look into this and push a fix. Also, thanks again for the detailed report and code inclusion. Will respond when we’ve released a fix!
Any update on a fix for this issue. I too am having the same problem. Right now i just divide whatever value i get by 1023 but it would be nice if i didn’t have that overhead in my code
Hi Guys,
I have same problem, I am not sure but I think it has something to do with
byte size, I can not believe this bug has not been discovered before releasing the software.
looking forward to get it fixed.
On the Web, I place a new slider control, select virtual pin/channel, set it to luminosity, set it to step by 1, and from 0 to 254. Thats all. Last time I tried this, If I moved the slider on the web it would show strange values on web page and also send them to my ESP. Now the slider behaves as expected on the web and on mobile, but the values it sends to the virtual pin is still mulitplied by 1023.
The code I use is pretty much the example code except for that I divide by 1023 to get my required values between 0 and 254
CAYENNE_IN(V3)
{
CAYENNE_LOG(“Got a value: %s”, getValue.asStr());
Blue = getValue.asInt() / 1023;
Serial.print(“Blue”);
Serial.println(Blue);
}
Thats it!
(Btw. if you create a Slider in the Web and then open your project in the Mobile Android App, you have to define the details of the slider again. For example it does not synchronize the stepping.)
I have same problem, Can add that, on iOS, if slider is set for min=0 / max = 1.0, if I move slider to 0.7, after a few seconds the indicated value will jump to 750.00 and the slider is redrawn all the way to the right, i.e. full scale.
Just checking in here, we’ve made several slider updates/fixes. This last one where the values are multiplied by 4 is still being worked on, keep you updated!
I am experiencing this same problem. I have a final year project presentation next week and the PWM out is critical for controlling my motor speed. I hope this gets fixed in time because right now i am thinking that i have to go back to the drawing board if this function is not up and running by that time. I am crazy nervous right now, Thank you guys for working on this problem.
Hello everyone! We’ve finally pushed out a fix for this issue. I’m sorry it took so long.
In order to facilitate the fix for the Arduino slider multiplication issue, we’ve released a small update to the Cayenne Arduino Library. You should be able to see the update in your Arduino IDE by going to Sketch > Include Libraries > Manage Libraries > Updatable.