DODATNI OPIS:

primer kode: link

knjižnica: link

delujoči primer kode:

#include "LedControl.h"
LedControl lc=LedControl(12,11,10,1);
// pin 12 is connected to the DIN pin
// pin 11 is connected to the CLK pin
// pin 10 is connected to the CS pin
// 1 as we are only using 1 MAX7219
//
void setup()
{
// the zero refers to the MAX7219 number, it is zero for 1 chip
lc.shutdown(0,false);// turn off power saving, enables display
lc.setIntensity(0,8);// sets brightness (0~15 possible values)
lc.clearDisplay(0);// clear screen
}
//
void loop()
{
//numbers 7 to 0
for (int a=0; a<8; a++)
{
lc.setDigit(0,a,a,false);
delay(100);
}
delay(1000);
//display number 8 on all segments
for (int a=0; a<8; a++)
{
lc.setDigit(0,a,8,false);
delay(100);
}
delay(1000);
//
for (int a=8; a>=0; a--)
{
lc.setDigit(0,a,a,false);
delay(100);
}
}