You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • That's a shame - I'd have thought that especially the code posted above, when compiled, would be more than fast enough.

    The other option is something like:

    var s = new SPI();
    s.setup({ miso : data_in_pin, sck : clk_out_pin });
    var d = s.send([0b10101010,0b10101010,0b10101010­,0b10101010,0b10101010,0b10101010,0b1000­0000]);
    var v = 0;
    for (var i=0;i<5;i++) {
      v = (v<<1) | ((d[i]>>6)&1);
      v = (v<<1) | ((d[i]>>4)&1);
      v = (v<<1) | ((d[i]>>2)&1);
      v = (v<<1) | (d[i]&1);
    }
    
About

Avatar for Gordon @Gordon started