arduino 8 (eight) 74HC595

need help for making running led matrix using 8(eight) 74HC595 and 1(one) 4017.also i need the code....thanks a lot for your help.

sort by: active | newest | oldest
iceng5 years ago
Take a look at the fourth item down on the right side of this page.

8 LED Chaser with 74HC595 8 Bit Shift Register
faisolhanif (author)  iceng5 years ago
what i need is 100 column (not 24 column). i just succed with 24 column, but fail in 100 column...thanks for your answer.Please help my project.
i assume you were able to link three 74HC595s. 
So what happened when you tried four?

A
faisolhanif (author)  iceng5 years ago
when 1 link to fourth 74CH595,my led run form the beginning(0 column), but when reach end of third 74CH595, led comeback to the first column.this is my code:

#define A {B01111100,B10000010,B10000010,B10000010,B10000010,B11111110,B10000010,B10000010,B10000010,B10000010}
#define AA {B00000000,B00000000,B00000000,B00000000,B11110000,B00001000,B01111000,B10001000,B10001000,B01111000}
#define B {B01111000,B10000100,B10000010,B10000010,B10000100,B11111000,B10000100,B10000010,B10000100,B11111000}
#define BB {B00000000,B00000000,B10000000,B10000000,B10000000,B11110000,B10001000,B10001000,B10001000,B11110000}
#define C {B00111000,B01000100,B10000010,B10000000,B10000000,B10000000,B10000000,B10000010,B01000100,B00111000}
#define CC {B00000000,B00000000,B00000000,B00000000,B01110000,B10001000,B10000000,B10000000,B10001000,B01110000}
#define D {B11111000,B10000100,B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B10000100,B11111000}
#define DD {B00000000,B00000000,B00001000,B00001000,B00001000,B01111000,B10001000,B10001000,B10001000,B01111000}
#define E {B01111100,B10000000,B10000000,B10000000,B10000000,B11111000,B10000000,B10000000,B10000000,B01111100}
#define EE {B00000000,B00000000,B00000000,B00000000,B01110000,B10001000,B10001000,B11110000,B10000000,B01111000}
#define FF {B01111100,B10000000,B10000000,B10000000,B10000000,B11111000,B10000000,B10000000,B10000000,B10000000}
#define FFF {B00000000,B00000000,B01110000,B10000000,B10000000,B11100000,B10000000,B10000000,B10000000,B10000000}
#define G {B00111100,B01000010,B10000000,B10000000,B10000000,B10011110,B10000010,B10000010,B01000010,B00111100}
#define GG {B00000000,B00000000,B01111000,B10001000,B10001000,B10001000,B01111000,B00001000,B00001000,B11110000}
#define H {B10000010,B10000010,B10000010,B10000010,B10000010,B11111110,B10000010,B10000010,B10000010,B10000010}
#define HH {B00000000,B00000000,B10000000,B10000000,B10000000,B10000000,B11110000,B10001000,B10001000,B10001000}
#define I {B01111100,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000,B01111100}
#define II {B00000000,B00000000,B01000000,B00000000,B11000000,B01000000,B01000000,B01000000,B01000000,B11100000}
#define J {B00001110,B00000010,B00000010,B00000010,B00000010,B00000010,B00000010,B01000010,B01000010,B00111100}
#define JJ {B00001000,B00000000,B00011000,B00001000,B00001000,B00001000,B00001000,B00001000,B01001000,B00110000}
#define K {B10000100,B10001000,B10010000,B10100000,B11000000,B11000000,B10100000,B10010000,B10001000,B10000100}
#define KK {B00000000,B00000000,B10001000,B10010000,B10100000,B11000000,B11000000,B10100000,B10010000,B10001000}
#define L {B10000000,B10000000,B10000000,B10000000,B10000000,B10000000,B10000000,B10000000,B10000000,B01111100}
#define LL {B00000000,B00000000,B10000000,B10000000,B10000000,B10000000,B10000000,B10000000,B10000000,B01110000}
#define M {B10000010,B11000110,B10101010,B10010010,B10010010,B10000010,B10000010,B10000010,B10000010,B10000010}
#define MM {B00000000,B00000000,B00000000,B00000000,B01000100,B10101010,B10010010,B10000010,B10000010,B10000010}
#define N {B10000010,B11000010,B10100010,B10100010,B10010010,B10010010,B10001010,B10001010,B10000110,B10000010}
#define NN {B00000000,B00000000,B00000000,B00000000,B11110000,B10001000,B10001000,B10001000,B10001000,B10001000}
#define O {B01111100,B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B01111100}
#define OO {B00000000,B00000000,B00000000,B00000000,B01110000,B10001000,B10001000,B10001000,B10001000,B01110000}
#define P {B11111000,B10000100,B10000100,B10000100,B11111000,B10000000,B10000000,B10000000,B10000000,B10000000}
#define PP {B00000000,B00000000,B11110000,B10001000,B10001000,B11110000,B10000000,B10000000,B10000000,B10000000}
#define Q {B01111100,B10000010,B10000010,B10000010,B10000010,B10000010,B10010010,B10010100,B10001000,B01110110}
#define QQ {B00000000,B00000000,B00000000,B00000000,B01110000,B10001000,B10001000,B10101000,B10010000,B01101000}
#define R {B11111000,B10000100,B10000100,B10000100,B11111000,B11000000,B10100000,B10010000,B10001000,B10000100}
#define RR {B00000000,B00000000,B00000000,B00000000,B01110000,B10000000,B10000000,B10000000,B10000000,B10000000}
#define ES {B01111110,B10000000,B10000000,B10000000,B01111100,B00000010,B00000010,B00000010,B00000010,B11111100}
#define ESS {B00000000,B00000000,B00000000,B00000000,B01110000,B10000000,B01100000,B00010000,B00010000,B11100000}
#define T {B11111110,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000}
#define TT {B00000000,B00000000,B10000000,B10000000,B10000000,B11100000,B10000000,B10000000,B10001000,B01110000}
#define U {B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B01111100}
#define UU {B00000000,B00000000,B00000000,B00000000,B10001000,B10001000,B10001000,B10001000,B10001000,B01110000}
#define V {B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B01000100,B01000100,B00101000,B00010000}
#define VV {B00000000,B00000000,B00000000,B00000000,B10001000,B10001000,B10001000,B10001000,B01010000,B00100000}
#define W {B10000010,B10000010,B10000010,B10000010,B10010010,B10010010,B10010010,B10101010,B11000110,B10000010}
#define WW {B00000000,B00000000,B00000000,B00000000,B10000010,B10000010,B10000010,B10010010,B10101010,B01000100}
#define X {B10000010,B01000100,B00101000,B00101000,B00010000,B00010000,B00101000,B00101000,B01000100,B10000010}
#define XX {B00000000,B00000000,B00000000,B00000000,B10000100,B01001000,B00110000,B00110000,B01001000,B10000100}
#define Y {B10000010,B10000010,B01000100,B00101000,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000}
#define YY {B00000000,B00000000,B10001000,B10001000,B10001000,B01111000,B00001000,B00001000,B10001000,B01110000}
#define Z {B11111110,B00000100,B00001000,B00001000,B00010000,B00010000,B00100000,B00100000,B01000000,B11111110}
#define ZZ {B00000000,B00000000,B00000000,B00000000,B11111000,B00001000,B00010000,B00100000,B01000000,B11111000}
#define angka1 {B01110000,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000,B00010000,B11111110}
#define angka2 {B01111100,B10000010,B00000010,B00000010,B00000100,B00001000,B00010000,B00100000,B01000000,B11111110}
#define angka3 {B01111100,B10000010,B00000010,B00000100,B00011000,B00000100,B00000010,B00000010,B10000010,B01111100}
#define angka4 {B00000110,B00001010,B00010010,B00100010,B01000010,B11111110,B00000010,B00000010,B00000010,B00000010}
#define angka5 {B11111110,B10000000,B10000000,B10000000,B01111100,B00000010,B00000010,B00000010,B00000010,B11111100}
#define angka6 {B01111100,B10000010,B10000000,B10000000,B11111100,B10000010,B10000010,B10000010,B10000010,B01111100}
#define angka7 {B11111110,B00000010,B00000010,B00000010,B00000100,B00001000,B00010000,B00100000,B01000000,B10000000}
#define angka8 {B01111100,B10000010,B10000010,B10000010,B01111100,B10000010,B10000010,B10000010,B10000010,B01111100}
#define angka9 {B01111100,B10000010,B10000010,B10000010,B10000010,B01111110,B00000010,B00000010,B10000010,B11111100}
#define angka0 {B01111100,B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B10000010,B01111100}
#define slash {B00000010,B00000100,B00000100,B00001000,B00010000,B00010000,B00100000,B01000000,B01000000,B10000000}
#define apostrop {B00000011,B00000001,B00000010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000}
#define DEVIDE{B00001000,B00010000,B00100000,B00100000,B01000000,B10000000}
#define TWODOTS{B01100000,B01100000,B00000000,B00000000,B01100000,B01100000}
#define DOT{B00000000,B00000000,B00000000,B00000000,B01100000,B01100000}
#define COMA{B00000000,B00000000,B00000000,B00110000,B00110000,B01100000}
#define LINE{B00000000,B00000000,B11111000,B11111000,B00000000,B00000000}
#define QUASTION{B01110000,B10001000,B00010000,B00100000,B00000000,B00100000}
#define MARK{B00100000,B01110000,B01110000,B00100000,B00000000,B00100000}
#define SPACE{B00000000,B00000000,B00000000,B00000000,B00000000,B00000000}


int latchPin = 10;
int clockPin = 13;
int dataPin = 11;
int clock = 9;
int Reset = 8;
int latchPinPORTB = latchPin - 8;
int clockPinPORTB = clockPin - 8;
int dataPinPORTB = dataPin - 8;
int i = 0;
long scrolling_word[10];
int array_turn=0;

byte your_text[54][10]={ES,EE,LL,AA,MM,AA,TT,SPACE,D,AA,TT,AA,NN,GG,SPACE,DD,II,SPACE,K,A,M,P,U,ES,SPACE,M,T,ESS,slash,M,A,SPACE,M,I,FF,T,A,H,U,L,SPACE,H,U,D,A,SPACE,K,A,N,G,K,U,N,G};

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);
setupSPI();
}

void display_word(int loops,byte word_print[][10],int num_patterns,int delay_langth){
i = 0;// resets the counter fot the 4017
for(int g=0;g<10;g++)
scrolling_word[g] = 0;
for(int x=0;x for(int r=0;r<10;r++)
scrolling_word[r] |= word_print[x][r];
for (int z=0;z<10;z++){
for(int p=0;p<10;p++)
scrolling_word[p] = scrolling_word[p] << 1;

for(int t=0;t for(int y=0;y<10;y++){
if(i == 10){
digitalWrite(Reset,HIGH);
digitalWrite(Reset,LOW);
i = 0;
}
latchOff();
spi_transfer(make_word(0x01000000,y));
spi_transfer(make_word(0x00010000,y));
spi_transfer(make_word(0x00000100,y));
latchOn();
delayMicroseconds(800);
latchOff();
spi_transfer(0);
spi_transfer(0);
spi_transfer(0);
latchOn();
digitalWrite(clock,HIGH);
digitalWrite(clock,LOW);
i++;
}
}
}
}
finish_scroll(delay_langth);
}

void finish_scroll(int delay_scroll){
for (int n=0;n<54;n++){
for(int h=0;h<10;h++)
scrolling_word[h] = scrolling_word[h] << 1;
for(int w=0;w for(int k=0;k<10;k++){
if(i == 10){
digitalWrite(Reset,HIGH);
digitalWrite(Reset,LOW);
i = 0;
}
latchOff();
spi_transfer(make_word(0x01000000,k));
spi_transfer(make_word(0x00010000,k));
spi_transfer(make_word(0x00000100,k));
latchOn();
delayMicroseconds(800);
latchOff();
spi_transfer(0);
spi_transfer(0);
spi_transfer(0);
latchOn();
digitalWrite(clock,HIGH);
digitalWrite(clock,LOW);
i++;
}
}
}
}

byte make_word (long posistion,byte turn){
byte dummy_word = 0;
for(int q=0;q<54;q++){
if(scrolling_word[turn] & (posistion< dummy_word |= 0x01< }
return dummy_word;
}


void loop() {

display_word(1,your_text,54,1);

}



void latchOn(){
bitSet(PORTB,latchPinPORTB);
}

void latchOff(){
bitClear(PORTB,latchPinPORTB);
}


void setupSPI(){
byte clr;
SPCR |= ( (1< //SPCR |= ( (1< SPCR &= ~( (1< clr=SPSR; // clear SPI status reg
clr=SPDR; // clear SPI data reg
SPSR |= (1< //SPSR &= ~(1<
delay(10);
}
byte spi_transfer(byte data)
{
SPDR = data; // Start the transmission
while (!(SPSR & (1< {
};
return SPDR; // return the received byte, we don't need that
}


Dear
Pls help me give me code for arduino
I----------------------I pin..1..... Led O O O O O O O O O O
I Arduino............. I------2.............O O O O O O O O O O
I----------------_----I--- --3 .............O O O O O O O O O O
.................................................._ I_I_I__I_I__I_I_I_I_I_I I_
.................................................... I 4017....................... I
.....................................................I ________________I

Work:
(LED on )
Pin 1 arduino : 1 1 1 1 1 1 1 1 1 1 1 << On
Pin 2 arduino : O O O O O O O O O << Off
Pin 3 arduino : O O O O O O O O O << Off
Delay 4 second

(LED on )
Pin 1 arduino : O O O O O O O O O << Off
Pin 2 arduino : 1 1 1 1 1 1 1 1 1 1 1 << On
Pin 3 arduino : O O O O O O O O O << Off
Delay 10 second

(LED on )
Pin 1 arduino : O O O O O O O O O << Off
Pin 2 arduino : O O O O O O O O O << Off
Pin 3 arduino : 1 1 1 1 1 1 1 1 1 1 1 << On
Delay 3 second
Fan out ?
Thank you, absolutely Right !

Asked our man to detail his experience, maybe a ckt diag and
what an 017 is planned for ?.
Then I'm working up to suggesting three or six other CPU lines or adding a buffer and . . . . he wants code too..
I may just buy an Arduino to answer these always come up .
Finally our author needs to consider his Power supplies to run his game.

BTW iv reached the grand age where rotating my numbers 180° is the same and success loosing it at weight watchers :-)

This year Burning man is doing a raffle for tickets, WHAT a mess up.
See my Soot ible for fun pics.