• but on the OLED I still see "Connected" and the temp is changing every 5 seconds. I guess it's because the Interval function that is still running

    Yes... so in BLE_Connect you call setInterval but you never clear that interval.

    Try:

    var updateInterval;
    
    function BLE_Connect(){ 
      updateInterval = setInterval(function() {
      ....
    }
    
    function BLE_Disconnect(){
      if (updateInterval) clearInterval(updateInterval);
      updateInterval=undefined;
      ...
    }
    
About

Avatar for Gordon @Gordon started