• I thought that must be it... but I moved the setWatch to pin 27, connecting with the + of the battery.

    When all I have is the two wires, the setWatch works perfectly responsive. But as soon as the serial is connected to D29, D30, D31 and a switch signal coming from D1 and D2, things go wrong.

    Even when I havent declared any serial, just the presence of the other connection interferes with the contact setWatch.. It responds, but sluggish, and it misses some disconnections.

    Powering on the serial device also triggers the setWatch.

    this is all the code.

    clearWatch();
    clearInterval();
    digitalWrite(D1,0);
    digitalWrite(D2,0);
    
    pinMode(D27, "input_pulldown");
    
    // do check on lost contact
    setWatch(function() {
      sendAlert();
    }, D27, { repeat: true, edge: 'falling', debounce: 50 });
    
    
    function sendAlert(){
    console.log("Contact lost");
    }
    
About

Avatar for user80197 @user80197 started