Multiple LED Matrices, integrated buttons?

So I’m creating a deadmau5 cosplay in which I have an 8x8 LED Matrix in each eye socket!
They’ll be reacting to button pushes, either running the same void loops (pulsing identical hearts), or different void loops (one “eye” stays open whilst the other “blinks”).

My question here is this…

Is this even possible? Every forum and answer so far has pointed to the answer no.

I’ve managed to get one LED matrix running a heart pulse loop by using the DIN CS and CLK pins effectively… but I cant seem to find a way to integrate the next LED matrix onto the board (and especially the sketch) without duplicating my setup.

eg)

int DIN = 12;
int CS =11;
int CLK = 10;
works for one board… but how do I define the other board?

This project is a lot of running into brick walls with no response from research or reddit so I hope im posting in the right place. Sketch has been attached :smiley:

Thanks!

heart_flash.ino (1.44 KB)

It can work, but

  • never use delay()
  • don't call them "void loops". They are called functions and you can only have one function called loop()
  • Saying you use DIN, CS, CLK saids nothing, they are just variables. But the fact you have to define them for that library I bed it does not use the SPI function of those pins (aka, you can use it on any pin).
  • If the matrix is driven by some soft of SPI device (shift register?) you can speed it up by using the SPI hardware. But again no idea if the library suppots it 9you did not link it)
LedControl lc(DIN, CLK, CS, 2);
/* 
 * Create a new controler 
 * dataPin      pin on the Arduino where data gets shifted out
 * clockPin     pin for the clock
 * csPin        pin for selecting the device 
 * numDevices   maximum number of devices that can be controled
*/
LedControl(byte dataPin, byte clkPin, byte csPin, byte numDevices=1);

RTFM.

@Whandall, at who’s that pointed?

To the OP's

deadmau5: int DIN = 12; int CS =11; int CLK = 10; works for one board... but how do I define the other board?

There is a demo sketch for cascaded devices attached to my LedControl library.

This may provide some additional information and example code.

https://arduinoplusplus.wordpress.com/2017/10/29/robot-eye-expressions-using-led-matrix-display/