You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Well, #2 should work - or: spi.send(new Uint8Array(sData.buffer));

    Is it possible that the byte ordering is wrong? I'm not 100% sure but does #2 have the same result as:

    for(i = 0; i < sData.length; i++)
      spi.send(String.fromCharCode(sData[i])+S­tring.fromCharCode(sData[i]>>8));
    

    The other option (faster than #1) may be:

    sData.forEach(function(s) {SPI.send([s>>8,s]);});
    

    But if #2 (or some variant) will work, that would be ideal.

About

Avatar for Gordon @Gordon started