Hello All,
I am using a push button thru interrupt in ports D6 and D7 in nodemcu, I put a capacitor and debounce routine also. All is working fine as expected, but when I insert a line with Blynk.virtualWrite to send a status to Blynk, the ESP reset at this stage. I tested with differents nodemcu and seems the same.
here is a part of the code involved in this:
pinMode(D6,INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(D6), onChange1, FALLING);
void onChange1() {
boolean debounce1 = false; //ignora leitura falsa
//se tiver trigger rapido e falso dentro do limite, vai ignorar
if((millis() - lastDebounceTime1) <= debounceDelay1) {
debounce1 = true;
}
lastDebounceTime1 = millis();
if(debounce1) return;
if (led1 == 0) {
digitalWrite(D3, HIGH);
led1 = 1;
Serial.println("LED-1 off");
Blynk.virtualWrite(V7, HIGH); <===== here is the issue when I insert the virtualWrite.
return;
}
if (led1 == 1) {
digitalWrite(D3, LOW);
led1 = 0;
Serial.println("LED-1 on");
// Blynk.virtualWrite(V7, LOW); <==== the same
return;
}
}
Have anyone seen this behavior?
Thanks
Werner