seems it's working now ! i removed the setChar() function and kept setDigit() and i made a count++ from 0 to 9 and when the count reach 9, it will display a letter on the display number 0 on the right looping threw an array containing the characters
but ! what i noticed is that the display addr should be always 0 but the number of digit must change if i wanna change from the first digit to the next going from right to left ! or, they made a mistake on the website and said in the comment number of display instead of number of MAX7219 !
here are the codes :
//We always have to include the library
#include <LedControl.h>
/*
Now we need a LedControl to work with.
***** These pin numbers will probably not work with your hardware *****
pin 12 is connected to the DataIn
pin 11 is connected to the CLK
pin 10 is connected to LOAD
We have only a single MAX72XX.
*/
LedControl lc=LedControl(12,11,10,1);
void setup() {
/*
The MAX72XX is in power-saving mode on startup,
we have to do a wakeup call
*/
lc.shutdown(0,false);
/* Set the brightness to a medium values */
lc.setIntensity(0,15);
/* and clear the display */
lc.clearDisplay(0);
Serial.begin(9600);
}
/*
This method will display the characters for the
word "Arduino" one after the other on digit 0.
*/
void writeArduinoOn7Segment() {
//lc.setChar(0,0,'2',false);
int i=0;
static int count = 0;
char array[9] = {'A','b','c','d','E','F','H','L','P'};
lc.setChar(0,0,array[count],false);
for(i=0; i<10; i++){
lc.setDigit(0, 1, i, false);
delay(250);
if(i == 9){
count++;
}
}
if(count == 9){
count = 0;
}
}
void loop() {
writeArduinoOn7Segment();
}