Hello,
I have daisy chained two HC959 ICs together and wired them up to 16 LEDs. The code below produces a Nightriders effect with the LEDs running up and down. Everything is working well but I must be doing something wrong as the LED 8 above or below the lit one very quickly flashes on too. This would be coming from the other IC so I think the issuebut not sure how to fix it?
SPI1.setup({ mosi:B5, sck:B3 });
var i = 2,
dir = true;
function loop() {
SPI1.send(i>>8,B8);
SPI1.send(i,B8);
if(dir) {
i = i<<1;
}
else {
i= i>>1;
}
// Change direction
if(i >= 25536 || i <= 2) {
dir = !dir;
}
}
setInterval(loop, 60);
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.
Hello,
I have daisy chained two HC959 ICs together and wired them up to 16 LEDs. The code below produces a Nightriders effect with the LEDs running up and down. Everything is working well but I must be doing something wrong as the LED 8 above or below the lit one very quickly flashes on too. This would be coming from the other IC so I think the issuebut not sure how to fix it?