johnathanalonzo1
Published

8x8 Matrix LED Arduino Project

A super simple project using just 3 items!

BeginnerFull instructions provided12,372
8x8 Matrix LED Arduino Project

Things used in this project

Hardware components

Arduino Mega 2560
Arduino Mega 2560
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
Adafruit 8x8 LED Matrix
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

led_8x8_matrix_demo_hUdxz3xWri.png

Code

8x8Matrix_LED.ino

Arduino
#include <LedControl.h>

int DIN = 10;
int CS =  9;
int CLK = 8;

//Main
byte Design1[8]= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
byte Design2[8]= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,};
byte Design3[8]= {0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,};
byte Design4[8]= {0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x07,};
byte Design5[8]= {0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x0F,};
byte Design6[8]= {0x00,0x00,0x00,0x01,0x03,0x07,0x0F,0x1F,};
byte Design7[8]= {0x00,0x00,0x01,0x03,0x07,0x0F,0x1F,0x3F,};
byte Design8[8]= {0x00,0x01,0x03,0x07,0x0F,0x1F,0x3F,0x7F,};
byte Design9[8]= {0x01,0x03,0x07,0x0F,0x1F,0x3F,0x7F,0xFF,};
byte Design10[8]= {0x03,0x07,0x0F,0x1F,0x3F,0x7F,0xFF,0xFF,};
byte Design11[8]= {0x07,0x0F,0x1F,0x3F,0x7F,0xFF,0xFF,0xFF,};
byte Design12[8]= {0x0F,0x1F,0x3F,0x7F,0xFF,0xFF,0xFF,0xFF,};
byte Design13[8]= {0x1F,0x3F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,};
byte Design14[8]= {0x3F,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,};
byte Design15[8]= {0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,};
byte Design16[8]= {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,};
byte Design17[8]= {0xBF,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,};
byte Design18[8]= {0xAF,0x5F,0xBF,0x7F,0xFF,0xFF,0xFF,0xFF,};
byte Design19[8]= {0xAB,0x57,0xAF,0x5F,0xBF,0x7F,0xFF,0xFF,};
byte Design20[8]= {0xAA,0x55,0xAB,0x57,0xAF,0x5F,0xBF,0x7F,};
byte Design21[8]= {0xAA,0x55,0xAA,0x55,0xAB,0x57,0xAF,0x5F,};
byte Design22[8]= {0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAB,0x57,};
byte Design23[8]= {0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,};


//Blink
byte BlinkOn1[8]= {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,};
byte BlinkOff1[8]= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
byte BlinkOn2[8]= {0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,};
byte BlinkOff2[8]= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};




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

void setup(){
 lc.shutdown(0,false);       //The MAX72XX is in power-saving mode on startup
 lc.setIntensity(0,15);      // Set the brightness to maximum value
 lc.clearDisplay(0);         // and clear the display
}

void loop(){ 

    
    
    printByte(Design1);
     
    delay(100);

printByte(Design2);
     
    delay(100);

printByte(Design3);
     
    delay(100);

printByte(Design4);
     
    delay(100);

printByte(Design5);
     
    delay(100);

printByte(Design6);
     
    delay(100);

printByte(Design7);
     
    delay(100);

printByte(Design8);
     
    delay(100);

printByte(Design9);
     
    delay(100);

printByte(Design10);
     
    delay(100);

printByte(Design11);
     
    delay(100);

printByte(Design12);
     
    delay(100);

printByte(Design13);
     
    delay(100);

printByte(Design14);
     
    delay(100);

printByte(Design15);
     
    delay(100);

printByte(Design16);
     
    delay(100);



//Blink1 

printByte(BlinkOn1);

delay(750);

printByte(BlinkOff1);

delay(750);

printByte(BlinkOn1);

delay(750);

printByte(BlinkOff1);

delay(750);

printByte(BlinkOn1);

delay(750);

//Design2

printByte(Design17);

delay(100);

printByte(Design18);

delay(100);

printByte(Design19);

delay(100);

printByte(Design20);

delay(100);

printByte(Design21);

delay(100);

printByte(Design22);

delay(100);

printByte(Design23);

delay(100);

//Blink2

printByte(BlinkOn2);

delay(750);

printByte(BlinkOff2);

delay(750);

printByte(BlinkOn2);

delay(750);

printByte(BlinkOff2);

delay(750);


}


void printByte(byte character [])
{
  int i = 0;
  for(i=0;i<8;i++)
  {
    lc.setRow(0,i,character[i]);
  }
}

Credits

johnathanalonzo1

johnathanalonzo1

0 projects • 2 followers

Comments