• No actually I didn't call the E.setConsole()

    If you don't call E.setConsole(null) then Bluetooth.on('data', won't be called so your code won't work. If you do call it you can still print with Bluetooth.println

    Basically adding this function within Bluetooth.on()?

    No... I mean just code like this:

    g.setFontAlign(0,0); 
    g.setFont("Vector",25);
    var gatt;
    NRF.on('connect', function(addr) {
      g.clear();
      g.setColor(255,0,0);
      g.drawString("Connected", g.getWidth()/2, g.getHeight()/2);
      setTimeout(()=>g.clear(), 1000);
    });
    function X(d) { g.drawString(d, g.getWidth()/2, g.getHeight()/2); } // <----- this
    NRF.on('disconnect', function(reason) {
      g.clear();
      g.setColor(0,0,255);
      g.drawString("Disconnected", g.getWidth()/2, g.getHeight()/2);
      setTimeout(()=> g.clear(), 1000);
    });
    
About

Avatar for Gordon @Gordon started