Help with codes to add 1 more shift register and add more to matrix LED
hi im working on 8x10 matrix leds , successful @ using guide
http://www.instructables.com/id/810-led-matrix-with-4017/
using 4017 , 74hc595
now want expand matrix 16x10.
i connected , worked added 74hc595 control second 8x10.
my problem want display text using both 8x10
im using code guide , modified think doesnt work
problem 1 sure im doing declaration of bytes wrong.
i tried code using original outputs given 2 shift register identical no luck
http://www.instructables.com/id/810-led-matrix-with-4017/
using 4017 , 74hc595
now want expand matrix 16x10.
i connected , worked added 74hc595 control second 8x10.
my problem want display text using both 8x10
im using code guide , modified think doesnt work
code: [select]
#define someshape {b0100001001000010,b1110011101000010,b0100001001000010,b0000000001000010,b0001100001000010,b0001100001000010,b1000000101000010,b1000000101000010,b0100001001000010,b0011110001000010 }
#define all {b1111111111111111,b1111111111111111,b1111111111111111,b1111111111111111,b1111111111111111,b1111111111111111,b1111111111111111,b1111111111111111,b1111111111111111,b1111111111111111 }
#define someshape2 {b0100001001000010,b1110011101000010,b0100001001000010,b0000000001000010,b0001100001000010,b0001100001000010,b1000000101000010,b1000000101000010,b0100001001000010,b0011110001000010 }
int datapin = 9;
int latchpin = 11;
int clockpin = 10;
int datapin2 = 2;
int latchpin2 = 3;
int clockpin2 = 4;
const int numpatterns = 2;//this number of patterns want display
byte patterns[numpatterns][10]={all,all};// patterns order
void setup(){
pinmode(datapin,output);
pinmode(clockpin,output);
pinmode(latchpin,output);
pinmode(datapin2,output);
pinmode(clockpin2,output);
pinmode(latchpin2,output);
//simple stuff here
pinmode(clock,output);
pinmode(reset,output);
//reseting 4017 ic, have this
digitalwrite(reset,high);
delaymicroseconds(5);
digitalwrite(reset,low);
}
void display_pattern(int loops)//int loop acts delay, take 8 msecands scan of rows int loops = 15 time it
{
for(x=0;x<numpatterns-1;x++){ // loop on patterns
for (int z=0;z<16;z++){ //scrolls 1 bite @ time
for(int t=0;t<loops;t++){// delay loops
while(1){
for(y=0;y<10;y++){// loops on array of bytes
byte temp = patterns[x][y];
byte temp_2=patterns[x+1][y];
digitalwrite(latchpin, 0);
shiftout(datapin, clockpin,msbfirst,((temp<<z)+(temp_2>>7-z)));//writes digital outputs, z how bites need scroll
digitalwrite(latchpin, 1);
delaymicroseconds(800);
digitalwrite(latchpin, 0);
shiftout(datapin, clockpin,msbfirst,0);
digitalwrite(latchpin, 1);
digitalwrite(clock,high);
digitalwrite(clock,low);
byte temp = patterns[x][y+8];
byte temp_2=patterns[x+1][y+8];
digitalwrite(latchpin2, 0);
shiftout(datapin2, clockpin2,msbfirst,((temp<<z)+(temp_2>>7-z)));//writes digital outputs, z how bites need scroll
digitalwrite(latchpin2, 1);
delaymicroseconds(800);
digitalwrite(latchpin2, 0);
shiftout(datapin2, clockpin2,msbfirst,0);
digitalwrite(latchpin2, 1);
digitalwrite(clock,high);
digitalwrite(clock,low);
}
}
}
}
}
}
void loop(){
display_pattern(15);// calls display_pattern function , says int loop = 15(if more loop pattern whould scrrol slower).
}
problem 1 sure im doing declaration of bytes wrong.
i tried code using original outputs given 2 shift register identical no luck
doesnt workin way not work?
Arduino Forum > Using Arduino > Programming Questions > Help with codes to add 1 more shift register and add more to matrix LED
arduino
Comments
Post a Comment