Simple push button notification from app only

Hi!
How can I setup and Eventor to send a notification when D1 is low or high?
In the widget I can only use Virtual pins, how can I map a Digital to Virtual pin?

i mainly want to use the app for events, and minimal coding if possible (for now).

Thank you for helping this noobie! :slight_smile:

Only by writing the values to vPIN.

How to forward values of D1 to V1?
I could not find a sample code.
edit:
is the “Blynk.virtualWrite” the one I need?
This is what I made so far:

void test1()
{
Blynk.virtualWrite(1,digitalRead(1)); //Assign D1 value (low/high) to V1
}

void setup()
{
  // Debug console
  Serial.begin(9600);

  Blynk.begin(auth, ssid, pass);
}

void loop()
{
  Blynk.run();
}

Yes. But it is highly advisable to use timers.

BlynkTimer timer;

void setup()
{
...
  timer.setInterval(15000,  sendDataDHT);
  timer.setInterval(60000,  sendDataBMP);
  timer.setInterval(7000,  sendDataOPS);
  timer.setInterval(2000,  sendDataPID);
...
}

void loop()
{
  Blynk.run();
  timer.run();
}

void sendDataDHT()
{
   int d =  digitalRead(1);
   Blynk.virtualWrite(V1, d);
 }
... Etc.

I’d also recommend sending the notification from the code rather than from using Eventor.

Pete.

1 Like

This is what I ended up with:

BlynkTimer timer;

void sendData()
{
   int d = digitalRead(D1);
   Blynk.virtualWrite(V1, d);
 }

void setup()
{
  Serial.begin(9600);   
  pinMode(D1, INPUT_PULLUP);
  timer.setInterval(1000L, sendData);
}
void loop()
{
  Blynk.run();
  timer.run();
}

It is working yay!
Although I do have a problem, but I am not sure if it is related to the code. When I add a new widget from the app, I no longer receive values from the board (NodeMCU v3), even if I restart the app, but when I reset the board it self then it works again.