En fait les 7 de ma table servais initialement à afficher LED par LED sur ma matrice, pour te mettre dans le contexte voici mon programme:
#include <Adafruit_GFX.h>
#include <RGBmatrixPanel.h>
#include <SPI.h>
#define CLK 8
#define LAT A3
#define OE 9
#define A A0
#define B A1
#define C A2
float NiveauSonore=0; //Variable re
int a=NiveauSonore;
byte tabdb[16][5]={
{0,0,0,0,7},
{0,0,0,0,7},
{0,7,7,0,7},
{7,0,0,7,7},
{7,0,0,0,7},
{7,0,0,7,7},
{0,7,7,0,7},
{0,0,0,0,0},
{0,0,0,0,0},
{7,7,7,7,0},
{7,0,0,0,7},
{7,0,0,0,7},
{7,7,7,7,0},
{7,0,0,0,7},
{7,0,0,0,7},
{7,7,7,7,0}
};
byte tab0[16][8]={
{0,0,7,7,7,7,0,0},
{0,7,7,7,7,7,7,0},
{7,7,0,0,0,0,7,7},
{7,7,0,0,0,0,7,7},
{7,7,0,0,0,0,7,7},
{7,7,0,0,0,0,7,7},
{7,7,0,0,0,0,7,7},
{7,7,0,0,0,0,7,7},
{7,7,0,0,0,0,7,7},
{7,7,0,0,0,0,7,7},
{7,7,0,0,0,0,7,7},
{7,7,0,0,0,0,7,7},
{7,7,0,0,0,0,7,7},
{7,7,0,0,0,0,7,7},
{0,7,7,7,7,7,7,0},
{0,0,7,7,7,7,0,0}
};
byte tab1[16][8]={
{0,0,0,7,7,0,0,0},
{0,0,7,7,7,0,0,0},
{0,7,7,7,7,0,0,0},
{7,7,7,7,7,0,0,0},
{0,0,0,7,7,0,0,0},
{0,0,0,7,7,0,0,0},
{0,0,0,7,7,0,0,0},
{0,0,0,7,7,0,0,0},
{0,0,0,7,7,0,0,0},
{0,0,0,7,7,0,0,0},
{0,0,0,7,7,0,0,0},
{0,0,0,7,7,0,0,0},
{0,0,0,7,7,0,0,0},
{0,0,0,7,7,0,0,0},
{7,7,7,7,7,7,7,7},
{7,7,7,7,7,7,7,7}
};
byte tab2[16][8]={
{7,7,7,7,7,7,7,7},
{7,0,0,0,0,0,7,7},
{0,0,0,0,0,0,0,7},
{0,0,0,0,0,0,0,7},
{0,0,0,0,0,0,0,7},
{0,0,0,0,0,0,7,7},
{0,7,7,7,7,7,7,7},
{7,7,7,7,7,7,7,0},
{7,7,0,0,0,0,0,0},
{7,0,0,0,0,0,0,0},
{7,0,0,0,0,0,0,0},
{7,0,0,0,0,0,0,0},
{7,0,0,0,0,0,0,0},
{7,0,0,0,0,0,0,0},
{7,7,0,0,0,0,0,7},
{7,7,7,7,7,7,7,7}
};
byte tab3[16]={
B01111100,
B11111110,
B00000110,
B00000110,
B00001100,
B00001100,
B00111100,
B00111100,
B00000110,
B00000011,
B00000011,
B00000011,
B10000011,
B10000110,
B01111100,
B00111000
};
byte tab4[16][8]={
{0,0,0,0,0,0,7,0},
{0,0,0,0,0,7,7,0},
{0,0,0,7,7,7,7,0},
{0,0,7,7,7,7,7,0},
{0,7,7,0,0,7,7,0},
{7,7,0,0,0,7,7,0},
{7,7,0,0,0,7,7,0},
{7,7,0,0,0,7,7,0},
{7,0,0,0,0,7,7,0},
{7,0,0,0,0,7,7,0},
{7,7,7,7,7,7,7,7},
{7,7,7,7,7,7,7,7},
{0,0,0,0,0,7,7,0},
{0,0,0,0,0,7,7,0},
{0,0,0,0,0,7,7,0},
{0,0,0,0,0,7,7,0}
};
byte tab5[16][8]={
{7,7,7,7,7,7,7,7},
{7,7,0,0,0,0,0,7},
{7,0,0,0,0,0,0,0},
{7,0,0,0,0,0,0,0},
{7,0,0,0,0,0,0,0},
{7,0,0,7,7,7,7,7},
{7,7,7,7,7,7,7,7},
{7,7,7,0,0,0,0,7},
{0,7,0,0,0,0,0,7},
{0,0,0,0,0,0,0,7},
{0,0,0,0,0,0,0,7},
{0,0,0,0,0,0,0,7},
{0,0,0,0,0,0,0,7},
{0,0,0,0,0,0,0,7},
{7,0,0,0,0,0,7,7},
{7,7,7,7,7,7,7,7}
};
byte tab6[16][8]={
{7,7,7,7,7,7,7,7},
{7,7,0,0,0,0,0,7},
{7,0,0,0,0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,0,0,0,0,0,0,7},
{0,0,0,0,0,0,0,7},
{0,0,0,0,0,0,0,7},
{0,0,0,0,0,0,0,7},
{0,0,0,0,0,0,0,7},
{7,0,0,0,0,0,7,7},
{7,7,7,7,7,7,7,7}
};
int x, y;
RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, false);
void setup () {
matrix.begin();
SPI.begin();
SPI.setBitOrder(LSBFIRST);
SPI.setDataMode(SPI_MODE0);
pinMode(10,INPUT);
Serial.begin(115200);
}
void loop()
{
if(digitalRead(10)!=HIGH)
{
NiveauSonore = (SPI.transfer(0)*0.507);
if(NiveauSonore-a >0.5)
{
NiveauSonore=(int)NiveauSonore+0.5;
}
if(NiveauSonore-a <0.5)
{
NiveauSonore=(int)NiveauSonore-0.5;
}
//Serial.println(NiveauSonore);
}
for (int j=0; j <= 15; j++)
for (int i=0; i <= 7; i++){
x=i;
y=j;
matrix.drawPixel(x, y, matrix.Color333(tab1[j][i],0,0));
}
for (int j=0; j <= 15; j++)
for (int i=0; i <= 7; i++){
x=i+9;
y=j;
matrix.drawPixel(x, y, matrix.Color333(tab3[j][i],0,0));
}
for (int j=0; j <= 15; j++)
for (int i=0; i <= 7; i++){
x=i+18;
y=j;
matrix.drawPixel(x, y, matrix.Color333(tab0[j][i],0,0));
}
for (int j=0; j <= 15; j++)
for (int i=0; i <= 4; i++){
x=i+27;
y=j;
matrix.drawPixel(x, y, matrix.Color333(tabdb[j][i],tabdb[j][i],tabdb[j][i]));
}
}
Maintenant il me suffirai juste d'allumer la LED qui correspond au bit à 1 et de laisser éteint celle qui est à 0.