Close

LED Matrix & 595 Test

A project log for Stylin' safety jacket.

I always feel like jackets needed more blinky sh*t. Now dreams become reality.

scissorfeindScissorfeind 12/09/2014 at 08:500 Comments

Here is a link to the video of an LED matrix display cycling through patterns using code shifted to the 595's from the Trinket.

https://drive.google.com/file/d/0B4NTxdyFQRYlalJTcllnOHJYWlE/view?usp=sharing

At this point I am honestly not sure which bits are corresponding with which pins on the LED matrix, but I am about to actually pay attention to what I am doing and make a drawing. More to come, I hope to get text characters to display before the end of the night!

Here is the code I am using, ripped off from the ShiftOut tutorial on the Arduino site:

//Pin connected to ST_CP of 74HC595
int latchPin = 8;
//Pin connected to SH_CP of 74HC595
int clockPin = 12;
////Pin connected to DS of 74HC595
int dataPin = 11;
int ledPin = 13;
int outputVal = 127;





void setup() {
//set pins to output so you can control the shift register
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}



void loop() {

digitalWrite(ledPin, LOW);
outputVal = 0;
for (int i=0 ; i < 256 ; i++){
Serial.println(i);
digitalWrite(latchPin, LOW);
// shift out the bits:
shiftOut(dataPin, clockPin, MSBFIRST, i);
shiftOut(dataPin, clockPin, LSBFIRST, i);



//take the latch pin high so the LEDs will light up:
digitalWrite(latchPin, HIGH);
// pause before next value:
delay(5); //extra fast for dazzlin'
digitalWrite(ledPin, HIGH);
delay(5);
}

}



Discussions