#include <LedControl.h>
#include "matrix.h"
LedControl U1_test = LedControl(28, 24, 26, 16);
void setup() {
Serial.begin(9600);
processLeds("1234432112344321");
U1_test.shutdown(0, false);
U1_test.setIntensity(0, 0);
U1_test.clearDisplay(0);
}
int* getLedPosition(int channel)
{
int *values = new int[3];
int module = 0;
int row = 0;
int column = 0;
int match = 0;
while(true)
{
match++;
if(match == channel)
{
values[0] = module;
values[1] = column;
values[2] = row;
return values;
}
column++;
if(column > 7)
{
column = 0;
row++;
}
if(row > 7)
{
row = 0;
module++;
}
}
}
void processLeds(char *str)
{
for (int k = 0; k < 16; k++)
{
int *values = getMatrix(&str[k]);
int counter = 0;
for (int i = 0; i < 8; i++)
{
for (int j = 0; j < 8; j++)
{
U1_test.setLed(k, j, i, values[counter] == 1);
counter++;
}
}
}
for (int m = 0; m < 128; m++) {
}
}
void loop() {
//processLeds();
}