LedCount Library

Hello All,
I have one Nano Every board and two MAX7219s connected to two 7-seg displays,
one 4-digit (lc1) and one 3-digit (lc2). In my declarations I have..
LedControl lc1 = LedControl(12,11,10,1);
LedControl lc2 = LedControl(7,6,5,1);
lc1 works fine but I cannot get lc2 to work. Do I have to drive all 7 displays from lc1?
I have them mounted on a PCB with the sets of displays 220mm apart. the Nano Every is close to the first Max with three lines going across the board to the other MAX. I thought I could do this with only three lines between them. Do I have to run another 10 wires between them and use just lc1?
Sorry forgot to add, I have in setup.....

  lc1.setIntensity(0, 6);  // 0 -- 15
  lc1.shutdown(0,false);  // wake up MAX7219
  lc2.setIntensity(0, 6);  // 0 -- 15
  lc2.shutdown(0,false);  // wake up MAX7219

and in loop ...

    lc1.setChar(0, 3, '-', false);
    lc1.setChar(0, 2, '-', false);
    lc1.setChar(0, 1, '-', false);
    lc1.setChar(0, 0, '-', false);

and...

    lc2.setDigit(0, 2, 0, false);
    lc2.setDigit(0, 1, 0, false);
    lc2.setDigit(0, 0, 0, false);

@Delta_G
I think I found a reference...
https://wayoda.github.io/LedControl/pages/software

if lc1 is working but lc2 not it might be that you messed up the wiring for lc2.
We can't see your wiring nor your code.

Thanks for the replies.
So my definition for lc2 is ok and it SHOULD work on different pins from lc1.
Is that correct? I will check wiring.

don't mix to many things.
Start with the hello World example vom LC and add a second display object.
No TM1637
No I2C
No BMP
No Interrupt.

We still can't see your wiring.

OK tried this code and again lc1 display works but lc2's does not.

#include <Wire.h>
#include <LedControl.h>
LedControl lc1 = LedControl(12, 11, 10, 1); //din, clk, load, no of max7219s
LedControl lc2 = LedControl(7, 6, 5, 1); //din, clk, load, no of max7219s

void setup()
{
  lc1.shutdown(0, false);  // wake up MAX7219
  lc1.setIntensity(0, 6);  // 0 - 15
  lc2.shutdown(0, false);  // wake up MAX7219
  lc2.setIntensity(0, 6);  // 0 - 15
}

void loop()
{
    lc1.setDigit(0, 3, 1, false);
    lc1.setDigit(0, 2, 2, false);
    lc1.setDigit(0, 1, 3, false);
    lc1.setDigit(0, 0, 4, false);

    
    lc2.setDigit(0, 3, 1, false);
    lc2.setDigit(0, 2, 2, false);
    lc2.setDigit(0, 1, 3, false);
 }

All library examples have a lc.clearDisplay in setup.
Change Module 1 by Module 2 to exclude a hardware error.

And just in case it wasn't mentioned already:
we don't see you wiring, nor your modules, nor your power source.

its ok. it was a hardware problem. there was a metal standoff pillar which was shorting pin 5 of lc2 to earth. thanks for the help all.

good to hear.

Just in case you prefer to have an easier possibility to print digits like

lc1.print(a);

I suggest you have a look at my modified library:
https://werner.rothschopf.net/201904_arduino_ledcontrol_max7219.htm

there is even the possibility to use HW-SPI (and reuse MOSI/CLK lines for both displays).

Cheers noiasca.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.