//8x8 LED Matrix chaser using Arduino and LED dot matrix display module //with two 74HC595 shift registers //picmicrolab.com int DataPin = 8; int ClockPin = 9; int LatchPin = 10; #define TimeDelay 50 void setup() { pinMode(LatchPin, OUTPUT); pinMode(ClockPin, OUTPUT); pinMode(DataPin, OUTPUT); } void loop() { //---------------HIGH-------------- SendData74HC595(0x80FE); delay(TimeDelay); SendData74HC595(0xc0FE); delay(TimeDelay); SendData74HC595(0xe0FE); delay(TimeDelay); SendData74HC595(0xf0FE); delay(TimeDelay); SendData74HC595(0x78FE); delay(TimeDelay); SendData74HC595(0x3cFE); delay(TimeDelay); SendData74HC595(0x1eFE); delay(TimeDelay); SendData74HC595(0x0fFE); delay(TimeDelay); SendData74HC595(0x07FE); delay(TimeDelay); SendData74HC595(0x03FE); delay(TimeDelay); SendData74HC595(0x01FE); delay(TimeDelay); SendData74HC595(0x00FE); delay(TimeDelay); //---------------MED-------------- SendData74HC595(0x80F7); delay(TimeDelay); SendData74HC595(0xc0F7); delay(TimeDelay); SendData74HC595(0xe0F7); delay(TimeDelay); SendData74HC595(0xf0F7); delay(TimeDelay); SendData74HC595(0x78F7); delay(TimeDelay); SendData74HC595(0x3cF7); delay(TimeDelay); SendData74HC595(0x1eF7); delay(TimeDelay); SendData74HC595(0x0fF7); delay(TimeDelay); SendData74HC595(0x07F7); delay(TimeDelay); SendData74HC595(0x03F7); delay(TimeDelay); SendData74HC595(0x01F7); delay(TimeDelay); SendData74HC595(0x00F7); delay(TimeDelay); //---------------LOW-------------- SendData74HC595(0x807f); delay(TimeDelay); SendData74HC595(0xc07f); delay(TimeDelay); SendData74HC595(0xe07f); delay(TimeDelay); SendData74HC595(0xf07f); delay(TimeDelay); SendData74HC595(0x787f); delay(TimeDelay); SendData74HC595(0x3c7f); delay(TimeDelay); SendData74HC595(0x1e7f); delay(TimeDelay); SendData74HC595(0x0f7f); delay(TimeDelay); SendData74HC595(0x077f); delay(TimeDelay); SendData74HC595(0x037f); delay(TimeDelay); SendData74HC595(0x017f); delay(TimeDelay); SendData74HC595(0x007f); delay(TimeDelay); //--------------------------------- } void SendData74HC595(int data) { digitalWrite(LatchPin, LOW); delay(5); // shift out highbyte shiftOut(DataPin, ClockPin, LSBFIRST, data); // shift out lowbyte shiftOut(DataPin, ClockPin, LSBFIRST, (data >> 8)); digitalWrite(LatchPin, HIGH); delay(5); }