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

    Yes, that looks fine - however there are limits on how much you can send by Bluetooth LE in one go - I believe 20 bytes at the moment - so you may need to send the data in several chunks, by just calling NRF.updateService from a setInterval.

    The only thing causing your data not to be freed is soundBuff=buf; - if you didn't have that I believe everything would be freed automatically.

    Actually seeing your data in nRF Connect is unlikely to be possible - while you can read the value of a characteristic, it's not set up to read repeated notifications - which is what you'd have to do to send the amount of data you want to send. You'd need your own app.

    The other option is actually to use the Bluetooth UART that's on by default. For instance you could write:

    function getData(clipSeconds) {
            var w = new Waveform(512*clipSeconds,{bits:8});
            w.on("finish", function(buf) {
              Bluetooth.write(buf);
            });
            w.startInput(D2,512);
          }
    

    And then writing "getData(2)\n" to the UART's RX characteristic would cause the TX characteristic to output all the data. You could view that on the Nordic UART app.

About

Avatar for Gordon @Gordon started