3

I'm very new to Arduino and this is my first project, so I may misunderstand something simple.

As a hardware I'm using 4 MAX7219 connected to Arduino UNO and a single diod for tests.

As a software I have Waoyda's LedControl 1.06 for MAX72XX.

It seems, I'm completely missing something, because with the code below, the diod is never lit, regardless on matrix position it is connected to.

#include "LedControl.h"

LedControl lc=LedControl(12,11,10,4);

void setup() {
  int devices=lc.getDeviceCount();
  for(int address=0;address<devices;address++) {
    lc.shutdown(address,false);
    lc.setIntensity(address,8)
    lc.clearDisplay(address);
  }
}

void loop() { 
  int devices=lc.getDeviceCount();

  for(int row=0;row<8;row++) {
    for(int col=0;col<8;col++) {
      for(int address=0;address<devices;address++) {
        lc.setLed(address,row,col,true);
      }
    }
  }
}

Some high res photos: 1, 2, 3

UPD: scheme added.

6
  • 1
    OK, I'll ask the stupid question first. No offence intended but have you plugged the LED in the right way around? Secondly can you by pass the chip and provide power to the row and columns and see the LED light? Are you connecting this to a separate power supply (I doubt the Arduino will run it) and if you are using a separate PSU have you connected the grounds? Aug 18, 2017 at 14:07
  • @CodeGorilla If I use one of the default examples, "07.Display > RowColumnScanning", then the diod is being lit on every position. So, it seems, everything is fine with the diod, board and power.
    – JustLogin
    Aug 18, 2017 at 14:12
  • 1
    Could you show us your wiring?
    – tuskiomi
    Aug 18, 2017 at 14:23
  • 1
    Add some debugging to the code. The way to do it is using the serial port and print out result like "int devices=lc.getDeviceCount();" so you can verify that it find the MAX chip(s). A god tutorial on serial: oxgadgets.com/2011/07/arduino-serial-communication.html
    – MatsK
    Aug 18, 2017 at 18:37
  • @tuskiomi added scheme
    – JustLogin
    Aug 21, 2017 at 8:21

1 Answer 1

1

OMG, the only problem was a typo in LedController initialisation! I used LedControl lc=LedControl(12,11,10,4); instead for LedControl lc=LedControl(11,12,10,4);. It seems the library has no error detection if passed data pin isn't really a data pin. Now everything works fine.

1
  • please give credit to those that supported you to find a solution.
    – MatsK
    Aug 21, 2017 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.