• Espruino and WS2801

    Espruino and WS2801

    Here is a quick and ugly code to drive 50 WS2801 LED modules on a Espruino board: 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556var nrOfPixels = 50; var rgb = new Uint8Array(nrOfPixels*3); var k=0,jj=0; SPI2.setup({baud:1000000, mosi:B15, sck:B13 }); USB.setup({baudrate:115200}); var serialBuffer = createRingBuffer(3); function sendDataOut() {   SPI2.send(rgb); } setInterval(function() {     jj=k;     for (var i=0;i<rgb.length;i+=3) {  …