BLYNK
BLYNK.IO       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Blynk menu widget keep sending a value

Hi! I’m working on developing certain modes and I want to know if it is possible for my Blynk project to keep on sending the same value when I select one of the cases on my widget menu.

I would really appreciate it if you know how to do this.

Thanks in advance!

Hi, I’m no expert but if you want your switch() case to run repeatedly you’ll have to place it inside the loop, because Blynk write only runs when the values get updated, get the index value of the menu using blynk write and assign it to a int variable, then with that execute the switch case function inside void loop()

@Lunaguja your description of what you are trying to achieve is rather vague, but I assume that you want to get a widget which is connected to a virtual pin to constantly re-send the widget value?
This isn’t how widgets work. The value is only sent from the app, via the server, to the hardware when the widget value changes.
If you then want to repeatedly trigger a piece of code running on your hardware, you should probably use a BlynkTimer for this.

You should maybe read this:

especially the “Overriding a Timer (auto/manual mode)” section. In your scenario you would probably use the widget to define the mode (auto/manual in my description).

Pete.

Thank you very much! That was exactly what I meant.

1 Like