Most recent activity
-
Hi,
I tested it with the following code and it does not work.
var modules = {}; SPI2.setup({mosi:B15, sck:B13}); modules.connect = function(/*=SPI*/_spi,/*=PIN*/_cs) { var spi = _spi; var cs = _cs; spi.send ([0xA,0xF],cs); // intensity -full spi.send ([0xB,0x7],cs); // scan limit - all 8 chars spi.send ([0xC,0],cs); // shutdown return { raw : function(val) { digitalWrite(cs,0); spi.send ([0x9,0]); // output raw data for (var i=0;i<val.length;i++) { spi.send([(i&7)+1,val[i]]); } spi.send([0x0C,1]); // no shutdown digitalWrite(cs,1); }, off : function() { spi.send([0xC,0],cs); }, intensity : function(i) { spi.send([0xA,E.clip(i*15,0,15)],cs); } }; }; var count = 0; function doSomerhingStupid() { if (count > 0) run(); count ++; } function run () { var max = modules.connect (SPI2,B14); digitalWrite (LED3, 1); max.off(); clearInterval(); setInterval(function() { digitalWrite (LED2, on); var c1r0 = Math.random () * 255; var c1r1 = Math.random () * 255; var c2r0 = Math.random () * 255; var c2r1 = Math.random () * 255; var c3r0 = Math.random () * 255; var c3r1 = Math.random () * 255; var c4r0 = Math.random () * 255; var c4r1 = Math.random () * 255; max.raw([0,c1r0,0,c2r0,0,c3r0,0,c4r0,1,c1r1,1,c2r1,1,c2r1,1,c3r1]); max.intensity (Math.random ()); on = !on; }, 200); } var on = 1; digitalWrite (LED1, 1); digitalWrite (LED2, 0); digitalWrite (LED3, 0); clearInterval(); setWatch(doSomerhingStupid, BTN1, {repeat:true,edge:"rising", debounce:1});
Here is a video.
https://www.youtube.com/watch?v=WEmp9NjJuwM
Do you have any idea what I did wrong?
Regards
Michael -
-
Hi,
i want to cascade multiple Max7219 8x8 LED like https://www.pjrc.com/teensy/td_libs_Matrix.html. Is this possible with the http://www.espruino.com/modules/MAX7219.js module?
Hi,
i took the new raw function and tested it again. It does not work at the moment.
Here is the actual code:
To see more details about the send-data, i added some print statements.
The output looks like follows. I am not sure, but it doesn't look correct.