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,0b10000000]);
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);
}
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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: