• Yeah sorry, the first connect within the .on('Connect') was removed, actually the only one is the last on the bottom.
    Just a question: is the event handler for the 'data' event called each time the Bangle receives something , correct?

    Here is my final code:

    Bluetooth.on('data', function(d) { 
      g.clear();
      g.setFont("Vector", 20);
      g.setColor(0,255,0);
      f = require("Storage").open(name, 'a');
      f.write(d + "\n");
      setTimeout(() => (g.drawString("Data", g.getWidth()/2, g.getHeight()/2)), 1000);
      setTimeout(()=>g.clear(),1500); 
      });
    
    NRF.on('connect', function(addr) {
      g.clear();
      g.setFont("Vector",15);
      g.setColor(255,0,0);
      g.drawString(addr,g.getWidth()/2, g.getHeight()/2);
      g.setFont("Vector",25);
      setTimeout(()=>g.drawString("Connected", g.getWidth()/2, g.getHeight()/2), 500);
      setTimeout(()=>g.clear(),1000); 
      E.setConsole(null);
    });
    
    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);
    });
    
    // Code
    
    g.setFontAlign(0,0); 
    g.setFont("Vector",25);
    delay = 5000;
    
    name = "MyFile";
    
    setInterval(function(){console.log(E.getTemperature());}, 1000);
    

    The thing is that when I send something from my laptop, bangle does not seem to receive it.

About

Avatar for Riccardokhm @Riccardokhm started