Hey,
I have never really posted, but I've been on arduino for a while. Never needed much help until now.
I made the 24x6 display from : http://www.instructables.com/id/Make-a-24X6-LED-matrix
It works fine. No problemos BUT I want to light up single LED on my matrix. It has 3x74HC595 for the columns and 1x4019 decade counter for the rows.
So, I get that shift register are bits that you push until the registry is full. In my case I have 24 bits to fill. I would need max 111111111111111111111111 which would be 0xFFFFFF, that takes care of the columns. And I would need to sync with the row.
Say I want to light up all first row of the matrix and not the other rows , I would do this “{0xFFFFFF,0x000000, 0x000000, 0x000000, 0x000000, 0x000000}”
I could define this as “A”, then I could have
int A[18] = {B00000000,B00000000,B00000001,B00000000,B00000000,B00000010,B00000000,B00000000,B00000100,B00000000,B00000000,B00001000,B00000000,B00000000,B00010000,B00000000,B00000000,B00100000};
The goal would have as input “A1,C1,A1,B1,C1” displayed with 500ms delay.
I think I am doing something wrong, maybe with the 8-bit..I am lost.
int A[18] = {B00000000,B00000000,B00000001,B00000000,B00000000,B00000010,B00000000,B00000000,B00000100,B00000000,B00000000,B00001000,B00000000,B00000000,B00010000,B00000000,B00000000,B00100000};
byte n[3] = {B00000000,B00000000,B00000001};
int latchPin = 10;
int clockPin = 13;
int dataPin = 11;
int clock = 9;
int Reset = 8;
int j = 6;
void setup(){
Serial.begin(9600);
pinMode(dataPin,OUTPUT);
pinMode(clockPin,OUTPUT);
pinMode(latchPin,OUTPUT);
pinMode(clock,OUTPUT);
pinMode(Reset,OUTPUT);
digitalWrite(Reset,HIGH);
digitalWrite(Reset,LOW);
}
void loop(){
//corde1
for(int i=0;i<15;i++){
if( j == 6){
digitalWrite(Reset,HIGH);
digitalWrite(Reset,LOW);
j = 0;
}
shiftOut(dataPin, clockPin, MSBFIRST, A[i]);
shiftOut(dataPin, clockPin, MSBFIRST, A[i+1]);
shiftOut(dataPin, clockPin, MSBFIRST, A[i+2]);
digitalWrite(latchPin, HIGH);
delay(10);
digitalWrite(latchPin, LOW);
digitalWrite(clock,HIGH);
digitalWrite(clock,LOW);
j++;
delay(500);
}
}