Virtualwrite for app button in "switch" mode

I have a virtual pin 2 that is associated with an app button in “switch” mode. I would like to be able to set the button to HIGH (with button highlighted in color) or LOW (with button not highlighted) from my device code. I’ve tried the following things, but nothing will change the highlighted color on the button.

  1. put the line Blynk.virtualWrite(2,HIGH) inside BLYNK_WRITE (2) function
  2. put the line Blynk.virtualWrite(2, HIGH) inside BLYNK_READ (2) function
  3. put the line Blynk.virtualWrite(2, HIGH) inside setup() function

Any suggestions?

This feature is not yet available (but will be in future). For now you could use LED widget. You could send 0 for LOW and 255 for HIGH.

1 Like