Slider Widget

Read this before creating new topic:

  1. I can’t find the search feature, so sorry.
  2. Couldn’t find anything
  3. I’m attempting to use the slider widget to input a setpoint, but I need it in .1 degree increments. It seems to only work in integer values even though I selected double
    • I’m using a Pi Pico W wifi
    • Android phone
    • Blynk server region : USA
    • Blynk Library version
    #define BLYNK_TEMPLATE_ID “xxx”
    #define BLYNK_TEMPLATE_NAME “wifi control”
    #define BLYNK_AUTH_TOKEN “Xxxx”

Are you referring to the values you see in the dashboard…

or the values that you see being returned in your sketch?

How exactly is your datastream configured?
If you’re using C++, are you using param.asFloat() in your BLYNK_WRITE(Vpin) statement?

Pete.

I’m just learning this so I am new to this terminology.
I’m Using Thonny and Micropython on the machine side. I have not tried hooking it up to wifi yet.
Yes, I’m talking about what it shows me on the console.
Here is the datastream for the slider.

It would be worth you reading through the documentation to familiarise yourself with the terminology.

By “console” do you mean the web dashboard?
If so, you need to adjust these settings…

Make sure it’s version 1.0.0 of the python library you’re using, otherwise it won’t work with Blynk IoT

Pete.

I’m running Micropython, not Python. Does it matter?

No, the library says:

Blynk library for Python. Works with Python 2, Python 3, MicroPython.

What matters is the version number, it has to be 1.0.0

Pete.

I’m not locating 1.0.0 the only things I’m seeing is 0.2.4 and 0.2.6
https://github.com/blynkkk/lib-python
An I in the wrong place? I’m find it very hard to navigate Github. Thanks in advance.

You should make use of the forum’s search facility…

Pete.

I found the V1.0.0 library, but the link on how to install using tools I have available (Thonny) are not available. The link is broken.
http://help.blynk.cc/getting-started-library-auth-token-code-examples/how-to-install-blynk-library-for-arduino

I think the link you were trying to follow was about installing the C++ library in the Arduino IDE. The correct link for this seems to be:

But I don’t see how it’s relevant to your situation/tools.

Pete.

So it looks like there is no guidance for the Rasperry Pi Pico W using the Thonny IDE. I think we started there and now we’ve ended there. I will seek elsewhere for help.

The GitHub page I linked you to shows how to install the packaged 0.2.0 release via a pip command, which you can do in Thonny. You then just need to replace the 0.2.0 files with the 1.0.0 files.

If you’re not able to follow those instructions then you need to read the Thonny documentation.

Pete.

Naw, that wasn’t it at all. As it turns out you need to create a /lib directory on the pico and but the library files in there. Everything works with no hocus pocus. You’d think they would mention something as simple as that. When importing the libraries in the main program the file names are case sensitive. I just drilled down in the link you gave until I got to the V1.0.0 file and put it where it belongs. I did the same with the BME280 library. I found the answer here:
https://www.youtube.com/watch?v=pbQVaCXS3wk

I’ve got my pico w to connect to blynk and the gauges are being driven, but I’m having a conceptual problem with getting data from the blynk slider back to the pico. I can’t locate example micro python code that shows how its done. What I’ve found are example that send data back as an integer and then somehow convert that for use on the device. Is there a way to send something like 97.7 from the slider back to the Pico? I’ve spent a couple of hours now looking at the docs and watching youtubes, but it just isn’t clicking. Thank in advance.

What result does the 02_on_virtual_change.py example give?

Pete.

I get an invalid syntax error on
def v3_write_handler(value):
I think in Micro Python you don’t use the V, just the virtual pin number. I changed it to
blynk.on(“v1”)
def v3_write_handler(value):
print(‘Current slider value: {}’.format(value[0]))

That fixed the syntax error removing the @.
Now it runs but does not connect to Blync
Before it would connect and update the 2 gauges but the slider would be overwritten by the device if I tried to change it. Maybe I don’t have the widget configured correctly and it is acting like an output instead of an input? I can’t find the info on changing it though.

I’m not sure you understand the concept of widgets like the slider widget.
You can write a value from your device to the widget (via the server) using the blynk.virtual_write command.
If your slider ios attached to a datastream with a min/max of 1-100 and you write a value of 50 to it then the slider will move to the midway position.

If you adjust the slider value with your finger, and set it to say 25 then this value will be sent to the device (via the server) and will trigger the write_handler routine in your script, returning the value of 25.

The widget is therefore both an input and an output device, without any change to the widget configuration.

Pete.

you are correct. Right now the slider is updating from the device and if I change the slider it goes back to the device value. How do I read the slider from the device? That is the piece I haven’t figured out. Every example I see is grabbing an interger value and then passing it through some sort of serial conversion. Does that works with a double precision value from the slider?

Pete.

02_on_virtual_change.py example does nothing that I can see. I am starting to think that Blynk 1.0.0 just doesn’t support the slider for the Pi Pico W. I spent over an hour with ChatGBT4 trying different things. None of them worked. I can drive meters just fine from the pico, I just can get the slider info back from blynk.

I have yet to see a clear example where this works on a Pi Pico running micropython. I think I’ll have to try circuit python as this is going nowhere.