You are reading a single comment by @psc1988 and its replies. Click here to read the full conversation.
  • Hi Gordon,

    so I just get zeros as values. I tried it with the hex code 0x04 (attention level).
    In the documentation in the link below I saw there are also a hex code to enable the outputs but I don´t konw how to integrate that into the espruino program.

    I added var buf = 0x04 in the code.

    Found this documentation on the thinkgear website with the codes:
    http://developer.neurosky.com/docs/doku.­php?id=thinkgear_communications_protocol­#data_payload

    
    var buf = 0x04 ;
    var gatt,characteristic;
    setWatch(function(e) {
    NRF.requestDevice({ filters: [{ adress: 'c4:64:e3:e8:d6:e9' }] }).then(function(device) {
      console.log("Found");
      return device.gatt.connect();
    }).then(function(g) {
      console.log("Connected");
      gatt = g;
      return gatt.getPrimaryService(
        "039afff0-2c94-11e3-9e06-0002a5d5c51b");­
    }).then(function(service) {
      return service.getCharacteristic(
        "039afff8-2c94-11e3-9e06-0002a5d5c51b");­
    }).then(function (c) {
      console.log("Got Characteristic");
      characteristic = c;
      characteristic.on('characteristicvaluech­anged', function(event) {
         processBrainData(event.target.value.buff­er);
      });
      return characteristic.startNotifications();
    }).then(function() {
      console.log("Connected.");
      enableOutput(buf1);
    });
          }, BTN, { repeat: true, edge: 'rising' });
    function processBrainData(buf) {
      var d = new Uint8Array(16);
      setInterval(function() {
      print(d.slice().map(x=>x.toString(16).pa­dStart(2,0)).join(" "));
    }, 500);
      }
    
About

Avatar for psc1988 @psc1988 started