You are reading a single comment by @user47955 and its replies. Click here to read the full conversation.
  • If it helps here is the code:

    SPI1.setup({sck:B3, miso:B4, mosi:B5});
    var nrf = require("NRF24L01P").connect( SPI1, C5, C4 );
    function onInit() {
      nrf.init([0,0,0,0,2], [0,0,0,0,1]);
    }
    onInit(); 
    
    
    dataLine = "";
    setInterval(function() {
      while (nrf.dataReady()) {
        var data = nrf.getData();
        for (var i in data) {
          var ch = data[i];
          if (ch===0 && dataLine!=="") {
            console.log(dataLine);
            // we could even save it onto an SD card using require('fs').appendFile("log.txt", dataLine+"\n");
            dataLine = "";
          } else if (ch!==0) {
            dataLine += String.fromCharCode(ch);
          }
        }
      }
    }, 50);
    
About

Avatar for user47955 @user47955 started