Modul LED 8×8 Dot Matrix Display
Cum desenam „Smiley Face” cu o matrice led 8×8
Necesar componente:
Placa Arduino
Modul LED 8×8 Dot Matrix Display
Fire jumper
DIN = 12
CS = 11
CLK = 10
COD EXEMPLU ARDUINO:
//–––––––––
#include <LedControl.h>
int DIN = 12;
int CS = 11;
int CLK = 10;
LedControl lc=LedControl(DIN,CLK,CS,0);
void setup(){
lc.shutdown(0,false);
lc.setIntensity(0,15);
}
void loop(){
byte SMILE[8]= {0x3C,0x42,0xA5,0x81,0xA5,0x99,0x42,0x3C};
printByte(SMILE);
delay(1000);
byte SAD[8]= {0x3C,0x42,0xA5,0x81,0x99,0xA5,0x42,0x3C};
printByte(SAD);
delay(1000);
}
void printByte(byte character [])
{
int i = 0;
for(i=0;i<8;i++)
{
lc.setRow(0,i,character[i]);
}
}
//–––––––