Skip to content

Instantly share code, notes, and snippets.

@endlessdev
Created June 15, 2017 03:23
Show Gist options
  • Save endlessdev/13af80f40feb98112d5c1674602b511a to your computer and use it in GitHub Desktop.
Save endlessdev/13af80f40feb98112d5c1674602b511a to your computer and use it in GitHub Desktop.
Arduino 8x8 Matrics LED
#include <LedControl.h>
#define DIN 12
#define CS 11
#define CLK 10
#define AMOUNT_LCD 3
#define NAME_FIRST {0x7C,0x50,0x7C,0x00,0xFE,0x38,0x44,0x38}
#define NAME_SECOND {0x18,0x24,0x18,0x00,0x7E,0x18,0x18,0x18}
#define NAME_LAST {0x48,0xB5,0x69,0x27,0xE5,0x07,0x00,0x00}
LedControl lc=LedControl(DIN, CLK, CS,AMOUNT_LCD);
const int NAMES[3][8] = {NAME_FIRST, NAME_SECOND, NAME_LAST};
void setup() {
for(int i = 0; i < AMOUNT_LCD; i++){
lc.shutdown(i,false); // turn off power saving, enables display
lc.clearDisplay(i); // clear screen
lc.setIntensity(i,15);
}
}
void loop() {
for(int i = 0; i<AMOUNT_LCD; i++)
for(int j =0; j<8; j++)
lc.setRow(i, NAMES[i][j], true);
}
@endlessdev
Copy link
Author

#include <LedControl.h>
#define DIN 12
#define CS 11
#define CLK 10

#define AMOUNT_LCD 3

#define NAME_FIRST {0x7C,0x50,0x7C,0x00,0xFE,0x38,0x44,0x38}
#define NAME_SECOND {0x18,0x24,0x18,0x00,0x7E,0x18,0x18,0x18}
#define NAME_LAST {0x31,0x4F,0x49,0x37,0x01,0x1E,0x12,0x1E}

LedControl lc=LedControl(DIN, CLK, CS,AMOUNT_LCD);

const byte NAMES[3][8] = {NAME_FIRST, NAME_SECOND, NAME_LAST};

void setup() {
lc.shutdown(0, false);
lc.setIntensity(0, 15);
lc.clearDisplay(0);
lc.shutdown(1, false);
lc.setIntensity(1, 15);
lc.clearDisplay(1);
lc.shutdown(2, false);
lc.setIntensity(2, 15);
lc.clearDisplay(2);
}

void loop() {
for(int l=0; l<8; l++) {
lc.setRow(2, l, NAMES[0][l]);
}
for(int l=0; l<8; l++) {
lc.setRow(1, l, NAMES[1][l]);
}
for(int l=0; l<8; l++) {
lc.setRow(0, l, NAMES[2][l]);
}
for(int i = AMOUNT_LCD; i>=0; i--){
for(int j =0; j<=15; j++){
lc.setIntensity(i,j);
delay(5);
}
}
for(int i = AMOUNT_LCD; i>=0; i--){
for(int j =15; j>=0; j--){
lc.setIntensity(i,j);
delay(5);
}
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment