That's great - thanks for posting up! It'll be really good to see how this turns out.
Where you're sending data, I don't think it matters what bytes you send at all (there's no mosi (output) pin specified so nothing will get sent anyway). Also you've set baud as 9500 - it's fine, but the chip itself seems to go up to 3000000, so you've got some headroom if you want to go a bit faster ;)
Also, in Espruino you can just call send once to get an array of all your data, like:
var d = SPI1.send(new Uint8Array(4 /* maybe you have 4 CD4014s */));
console.log(d[0].toString());
// etc etc
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 great - thanks for posting up! It'll be really good to see how this turns out.
Where you're sending data, I don't think it matters what bytes you send at all (there's no
mosi
(output) pin specified so nothing will get sent anyway). Also you've set baud as 9500 - it's fine, but the chip itself seems to go up to 3000000, so you've got some headroom if you want to go a bit faster ;)Also, in Espruino you can just call
send
once to get an array of all your data, like:Might be a bit tidier.