Hi,
I keep getting disconnected from the blynk server whenever an interrupt is detected.
This is a simple code to detect interrupts on pin D7 (connected to a radiation geiger counter)
(Using nodemcu with wifi). I’m probably doing something very stupid, sorry. Any help is appreciated!
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
int bitoque = 0;
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "";
char pass[] = "";
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
attachInterrupt(D7,GetEvent,FALLING); // Geiger event on pin 2 triggers interrupt
}
void loop()
{
Blynk.run();
}
void GetEvent()
{ // ISR triggered for each new event (count)
bitoque++;
Blynk.virtualWrite(60, bitoque);
return;
}