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.

Revisions

  1. endlessdev created this gist Jun 15, 2017.
    27 changes: 27 additions & 0 deletions 8x8_matrix_led.c
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    #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);
    }