Arduino Model: Arduino Uno with Ethernet Shield (W5100)
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.
Here is how to make that:
And this is what it should look like:
And that looks fine - UNTIL you move the slider. (See example below):
Ok - that did not seem right. So I decided to change the maximum value on the slider to 4.
And here are the results for the first 4 numbers:
As you can see, the value of the slider is moving up in multiples of 1023.00
Here is the Arduino Sketch that I used:
Hey @arduinobasics1 !
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
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.
yup im doing the div by 1023 as well…
Just playing around with the sliders, unfortunately the issue still exists.
This is being worked on right now
Unfortunately this is still broken! Looks OK on the dashboard now, but the value transmitted to the Arduino is still the wrong one.
Yes I don’t think we have pushed fix for this yet. Will double check with the team.
Can you share your steps for producing the issue? This will be helpful for us to test to make sure is 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.
This is the slider.
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_LOG(“Got a value: %s”, getValue.asStr());
Blue = getValue.asInt() / 1023;
(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.
Yep, we’re still working on this one. We’ve made other fixes to the slider widget, and this is the last fix we will be making. hang in there!
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!
Great! Thank you for being responsive. It makes a big difference to us out in the field.
Same here, gald your fixing it. really needing that function for work.
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.
Thanks a lot for your updates and work on this issue. I hope it can be resolved in the near future. You guys are awesome!!
What is the exact issue you are experiencing? I see a couple mentioned here.
@adam @romainehayden11 @themixflow @juni @roman.schaal @tim2 @maxcoxir @aaronwillems @arduinobasics1
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.
Let us know if you find that the issue persists.