Blynk button turn it all OFF

Hello I created a sketch on arduino with a button “turn it all off” then pressing the d7 button go off d2-d3-d4 etc …, now the problem is that if I turn off the buttons that are turned on via the “Shutdown all”
"they really turn off but they always stay ON in the app blynk, does anyone know how to fix? the buttons are all synchronized the state of widgets with hardware states,
even if hardware resets or looses connection temporarily


And the code that does all this is…?

//#define BLYNK_PRINT DebugSerial
#define BLYNK_PRINT SwSerial //LED
#include <SoftwareSerial.h>
SoftwareSerial DebugSerial(0, 1); // RX, TX
SoftwareSerial SwSerial(10, 11); // RX, TX
#include <BlynkSimpleStream.h>

int pin2 = 2;
int pin3 = 3;
int pulsante = 7;
int stato_pulsante;

void setup() {
  pinMode(pin2, OUTPUT);
  pinMode(pin3, OUTPUT);
  pinMode(pulsante, INPUT);
  Blynk.begin(Serial, auth);
 void loop() {
  stato_pulsante = digitalRead(pulsante);
  if (stato_pulsante == HIGH) {
    digitalWrite(pin2, HIGH);
    digitalWrite(pin3, HIGH);;

Absolutely nothing Blynk related that (originally posted) code… and it is missing closing brackets… are you in the correct forum :stuck_out_tongue:

And I had forgotten the brackets :), and there is no way to synchronize the change to blynk app ?

Lots of ways… but they require Virtual pins, Blynk functions, commands, etc. Search this forum for keywords like syncing physical buttons/pins with App buttons etc… even one example here…

in another test I created the virtual pin led and it works perfectly only that I can not sync the graphic buttons that always remain ON :frowning:

Dude… try searching this forum for the many other topics and examples showing how to do that exact thing :stuck_out_tongue:

For example… a button widget being synchronized with another timer action to properly show the current pin state.

1 Like