Hey guys I'm pretty new to Arduino programming, so far I've made few simpler programmes but now I have decided to make a LED matrix 4x4 but it seems that even with this few LEDs, and when I made a programm to multiplex them one by one, they are dimmed.
I'm using a shift register 74HC595.
http://www.nxp.com/documents/data_sheet/74HC_HCT595.pdf
Now, I know I can make them light all at the same time, but I'm planning to make an LED cube 5x5x5 for my graduation project so I've started from something simpler just to learn the basics and then go to more complex stuff, but this is absolutly frustrating.
I would be very apriciative if someone would take some time for me and write the simplest program for SPI library with some short comments
I have some basic programming skills but only in C++ and it helped me quite a lot. Here is a example programm that I made for lighting one LED at the time.
int latchPin = 8;
int clockPin = 13;
int dataPin = 12;
void setup(){
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}
void loop(){
for(int i=0; i<4; i++){
for(int j=4; j<8; j++){
int x = pow(2,i)+1+pow(2,j);
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, x);
digitalWrite(latchPin, HIGH);
delay(200);
}
}
}
Sorry if my English is bad.