• Ok i successfully managed to trigger the X.on("data"...) event, but it is not evoked when I tried to send again another message.

    Bluetooth.on('data', function(d) { 
      g.clear();
      g.setFont("Vector", 20);
      g.setColor(0,255,0);
      //buf += d;
      //var l = buf.split("\n");
      //buf = l.pop();
      //l.forEach(onLine);
      //console.log(value);
      //c = d.getInt16(0);
      const buffer = new ArrayBuffer(16);
      const view = new DataView(buffer);
      c = view.getInt16(0);
      g.drawString(c, g.getWidth()/2, g.getHeight()/2);
      setTimeout(()=>g.clear(),1500); 
      });
    
    

    Does the function(d) return a dataview?

About

Avatar for Riccardokhm @Riccardokhm started