Hi,
I’m trying to do a very simple thing.
I have one switch on my device and one LED on my Dashboard.
I would like to detect a switch change in state and do a single virtual write to the virtual pin to change the state of the LED on the dashboard?
I’d rather not use a timer, this works, but consumes needless bandwidth for a simple switch, and builds in a latency.
This is my attempt at doing this but it causes a flood error pretty fast.
define BUTTON1 V2 \virtual pin 2 with LED on dashboard
define BUTTON1_P 4 \switch connected to hardware pin 4
int B1V;
void loop()
{
Blynk.run();
B1V=digitalRead(BUTTON1_P);
if(B1V!=BUTTON1) Blynk.virtualWrite(BUTTON1,digitalRead(BUTTON1_P));
}