MAX7219 with Matrix Leds

Posted on
  • Hello guys, I recently bought from ebay two Matrix Leds based on the Max7219, when I connect them to the espruino it powers everything up and then using the web IDE I send this code to the espruino:

    SPI2.setup({mosi:B15, sck:B13});
    var disp = require("MAX7219").connect(SPI2,B14);
    
    
    setTimeout(function() {
      disp.raw([1,2,4,8,16,32,64,128]); // you can set the LEDs directly
    }, 1000);
    
    setTimeout(function() {
      var n = 0;
      setInterval(function() {
        disp.set(n++); // it can display integers
        disp.intensity(0.5+0.5*Math.sin(n*0.2));­ // you set set intensity
      }, 100);
    }, 2000);
    

    But nothing happens, any idea?

  • Does it just hang without showing a > prompt on the left hand side?

  • well nope, this is all it shows

    _____                 _ 
    |   __|___ ___ ___ _ _|_|___ ___ 
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v56 Copyright 2014 G.Williams
    >echo(0);
    =undefined
    Erasing Flash.....................
    Programming 36000 Bytes...................................­....
    Checking...
    Done!
    >reset();
    =undefined
    

    greetings

  • so I tested the same matrix with the arduino and looks ok, does it mean I nead the sd card? or what is the difference of using the SD card?

  • No, you don't need the SD card for that.

    The code you pasted isn't exactly what you sent over, because somewhere there's a save() command and a reset() command?

    What happens if you put exactly what you wrote into the right-hand side of the Web IDE and click 'Send to Espruino'? I've just tried it and it works with a MAX7219 here.

  • oh yes, I was testing both, with and without the save(), but in both cases behaves the same, I even upgraded the firmware

    greetings

  • Same happens to me. When i powerup the Espruino the matrix takes a second or so to startup, then every led turns on. Nothing happens after that, not even disp.off()

  • Are you sure you've connected the wires up exactly as in http://www.espruino.com/MAX7219

    And that you've got the right end (the DIN end, not the DOUT end)

    I've just tried again with 1v60, and it still works perfectly.

  • Huh, just tried my other module and it worked, so it was most likely the wiring. But i'm sure i checked that yesterday. Thanks Gordon you're always so quick to reply.

    EDIT: both modules work

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

MAX7219 with Matrix Leds

Posted by Avatar for andres.santos @andres.santos

Actions