Hi all
I have an Arduino UNO, connected to wifi over USB.
Sketch code here: https://github.com/sunrunner4kr-simon/inittracker/tree/main
I’m trying to sync a set of virtual pins in the BLYNK_CONNECTED call, and it just crashes the app.
So i decided to do some testing, and put a single virtual pin sync (V6) in a button widget function.
BLYNK_WRITE(V5)
{
if (param.asInt() == 1) {
printValues();
CURRENT_SEAT = 100;
NEXT_SEAT = 100;
clearAll();
strcpy(player[0].name, "shanko");
strcpy(player[1].name, "sael");
strcpy(player[2].name, "kae");
strcpy(player[3].name, "tree");
strcpy(player[4].name, "gith");
strcpy(player[5].name, "otadus");
strcpy(player[6].name, "monster1");
strcpy(player[7].name, "monster2");
strcpy(player[8].name, "monster3");
strcpy(player[9].name, "monster4");
strcpy(player[10].name, "owl");
strcpy(player[11].name, "monster5");
player[0].value = 0;
player[1].value = 0;
player[2].value = 0;
player[3].value = 0;
player[4].value = 0;
player[5].value = 0;
player[6].value = 0;
player[7].value = 0;
player[8].value = 0;
player[9].value = 0;
player[10].value = 0;
player[11].value = 0;
Blynk.syncVirtual(V6);
printValues();
Blynk.virtualWrite(V30, "resetting");
}
}
So i’m expecting to see, sent to V30 (my terminal widget):
“0 enabled”
…
“resetting”
However, when i click this button widget(V5), instead of displaying whatever output I have in the BLYNK_WRITE of V6 (see below), it instead outputs the comment i have in the BLYNK_CONNECTED().
“sync complete”
Which to me, really doesn’t make any sense. It even doesn’t output the virtualWrite to V30 in the button function after the sync command.
BLYNK_WRITE(V6)
{
int i = param.asInt();
player[0].enabled = i;
Blynk.virtualWrite(V30, "0 enabled");
}
Does syncVirtual call BLYNK_CONNECTED somehow??
Thanks for any advice!
Simon