process_iconsetelah teman teman howrudi membaca artikel dan uji cobe source code rangkaian led matrix 24×6 sekarang kita lanjut pengembangan led matrix 24×6 ke led matrix 48×6. berikut source codenya.
sorce code led matrix 48×6
/*
* Created : Rudianto www.howrudi.com led matrix 48×6
*/
#define BA {B01110000,B10001000,B10001000,B11111000,B10001000,B10001000}
#define BB {B11110000,B10001000,B10001000,B11110000,B10001000,B11111000}
#define BC {B11111000,B10000000,B10000000,B10000000,B10000000,B11111000}
#define BD {B11110000,B10001000,B10001000,B10001000,B10001000,B11110000}
#define BE {B11111000,B10000000,B10000000,B11110000,B10000000,B11111000}
#define BF {B11111000,B10000000,B10000000,B11110000,B10000000,B10000000}
#define BG {B01110000,B10001000,B10000000,B10011000,B10001000,B01110000}
#define BH {B10001000,B10001000,B11111000,B10001000,B10001000,B10001000}
#define BI {B11111000,B00100000,B00100000,B00100000,B00100000,B11111000}
#define BJ {B00111000,B00010000,B00010000,B00010000,B10010000,B01100000}
#define BM {B10001000,B11011000,B10101000,B10101000,B10001000,B10001000}
#define BN {B10001000,B11001000,B10101000,B10101000,B10011000,B10001000}
#define BL {B10000000,B10000000,B10000000,B10000000,B10000000,B11111000}
#define BO {B01110000,B10001000,B10001000,B10001000,B10001000,B01110000}
#define BP {B11110000,B10001000,B10001000,B11110000,B10000000,B10000000}
#define BQ {B01110000,B10001000,B10101000,B10011000,B01111000,B00001000}
#define BR {B11110000,B10001000,B10001000,B11110000,B10001000,B10001000}
#define BS {B01110000,B10001000,B01100000,B00010000,B10001000,B01110000}
#define BK {B10001000,B10010000,B11100000,B11100000,B10010000,B10001000}
#define BT {B11111000,B00100000,B00100000,B00100000,B00100000,B00100000}
#define BU {B10001000,B10001000,B10001000,B10001000,B10001000,B01110000}
#define BV {B10001000,B10001000,B10001000,B10001000,B01010000,B00100000}
#define BW {B10001000,B10001000,B10101000,B10101000,B10101000,B01010000}
#define BX {B10001000,B01010000,B00100000,B00100000,B01010000,B10001000}
#define BY {B10001000,B01010000,B00100000,B00100000,B00100000,B00100000}
#define BZ {B11111000,B00001000,B00110000,B01100000,B10000000,B11111000}
#define LA{B00000000,B01110000,B00001000,B01111000,B10001000,B01111000}
#define LB{B10000000,B10000000,B10110000,B11001000,B10001000,B11110000}
#define LC{B00000000,B01110000,B10000000,B10000000,B10001000,B01110000}
#define LD{B00001000,B00001000,B01111000,B10001000,B10001000,B01111000}
#define LE{B00000000,B01110000,B10001000,B11111000,B10000000,B01110000}
#define LF{B00110000,B01001000,B01000000,B11100000,B01000000,B01000000}
#define LG{B00000000,B01111000,B10001000,B01111000,B00001000,B01110000}
#define LH{B10000000,B10000000,B10110000,B11001000,B10001000,B10001000}
#define LI{B00100000,B00000000,B01100000,B00100000,B00100000,B01111000}
#define LJ{B00010000,B00000000,B00111000,B00010000,B10010000,B01100000}
#define LK{B10000000,B10010000,B10100000,B11000000,B10100000,B10010000}
#define LL{B01100000,B00100000,B00100000,B00100000,B00100000,B01111000}
#define LM{B00000000,B00000000,B11010000,B10101000,B10101000,B10001000}
#define LN{B00000000,B00000000,B10110000,B11001000,B10001000,B10001000}
#define LO{B00000000,B01110000,B10001000,B10001000,B10001000,B01110000}
#define LP{B00000000,B11110000,B10001000,B11110000,B10000000,B10000000}
#define LQ{B00000000,B01101000,B10011000,B01111000,B00001000,B00001000}
#define LR{B00000000,B00000000,B10110000,B11001000,B10000000,B10000000}
#define LS{B00000000,B01110000,B10000000,B01110000,B00001000,B11110000}
#define LT{B01000000,B01000000,B11100000,B01000000,B01001000,B00110000}
#define LU{B00000000,B00000000,B10001000,B10001000,B10011000,B01101000}
#define LV{B00000000,B00000000,B10001000,B10001000,B01010000,B00100000}
#define LW{B00000000,B00000000,B10001000,B10101000,B10101000,B01010000}
#define LX{B00000000,B10001000,B01010000,B00100000,B01010000,B10001000}
#define LY{B00000000,B10001000,B10001000,B01111000,B00001000,B01110000}
#define LZ{B00000000,B11111000,B00010000,B00100000,B01000000,B11111000}
#define SPACE{B00000000,B00000000,B00000000,B00000000,B00000000,B00000000}
#define NUM0{B01110000,B10011000,B10101000,B10101000,B11001000,B01110000}
#define NUM1{B00100000,B01100000,B10100000,B00100000,B00100000,B01110000}
#define NUM2{B01110000,B10001000,B00001000,B01110000,B10000000,B11111000}
#define NUM3{B11110000,B00001000,B00001000,B01111000,B00001000,B11110000}
#define NUM4{B10001000,B10001000,B10001000,B11111000,B00001000,B00001000}
#define NUM5{B11111000,B10000000,B11110000,B00001000,B10001000,B01110000}
#define NUM6{B11111000,B10000000,B11111000,B10001000,B10001000,B11111000}
#define NUM7{B11111000,B00001000,B00001000,B01111000,B00001000,B00001000}
#define NUM8{B11111000,B10001000,B11111000,B10001000,B10001000,B11111000}
#define NUM9{B11111000,B10001000,B11111000,B00001000,B00001000,B11111000}
#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}

int latchPin = 10; //latch pin of the shift register
int clockPin = 13; //clock pin of the shift register
int dataPin = 11; //data pin of the shift register
int clock = 9; //clock pin of the 4017 counter
int Reset = 8; //reset pin of the 4017 counter

// setting the pins for easy operation with PORTB
int latchPinPORTB = latchPin – 8;
int clockPinPORTB = clockPin – 8;
int dataPinPORTB = dataPin – 8;
int i = 0;
byte scrolling_word[8][7];// this is for the scrolling text
int array_turn=0;
byte your_text[8][6]={BR,BU,BD,BI,BA,BN,BT,BO};//PUT YOU TEXT HERE

void setup(){
Serial.begin(9600);//starting communicatino with the PC at 9600 boud
// config for all the pins
pinMode(dataPin,OUTPUT);
pinMode(clockPin,OUTPUT);
pinMode(latchPin,OUTPUT);
pinMode(clock,OUTPUT);
pinMode(Reset,OUTPUT);
//reseting the 4017 counter
digitalWrite(Reset,HIGH);
digitalWrite(Reset,LOW);
setupSPI();//starting SPI communication
}

void display_word(int loops,byte word_print[][6],int num_patterns,int delay_langth){ // the main funcion for displaying and scrolling the word
i = 0;
for(int first=0;first<6;first++){ // reseting the scrolling_word array
for(int second=0;second<6;second++)
scrolling_word[first][second] = 0x00;
}

for(int x=0;x<num_patterns;x++){//main loop that goes over all of the symbols
for(int scroll=0;scroll<6;scroll++){// loop for scrolling, each symbols scrolls for 6 columns
for(int r=0;r<6;r++){//going over all of the rows
scrolling_word[r][6] = (scrolling_word[r][6] << 1)+((scrolling_word[r][5] & 0x80) >> 7);
scrolling_word[r][5] = (scrolling_word[r][5] << 1)+((scrolling_word[r][4] & 0x80) >> 7);
scrolling_word[r][4] = (scrolling_word[r][4] << 1)+((scrolling_word[r][3] & 0x80) >> 7);
scrolling_word[r][3] = (scrolling_word[r][3] << 1)+((scrolling_word[r][2] & 0x80) >> 7);
scrolling_word[r][2] = (scrolling_word[r][2] << 1)+((scrolling_word[r][1] & 0x80) >> 7);
scrolling_word[r][1] = (scrolling_word[r][1] << 1)+((scrolling_word[r][0] & 0x80) >> 7);
scrolling_word[r][0] = (scrolling_word[r][0] << 1)+(((word_print[x][r]<<scroll)&0x80)>>7);
}
for(int t=0;t<delay_langth;t++){// a delay loop that just shows the same frame over and over to create a delay
for(int y=0;y<6;y++){// the scaning loop that goes over all 6 rows
if(i == 6){//if the 4017 counter counts up to 6 reset it
digitalWrite(Reset,HIGH);
digitalWrite(Reset,LOW);
i = 0;// resetinf the counter
}
latchOff();// starint the communication with the shift registers
spi_transfer(scrolling_word[y][6]);
spi_transfer(scrolling_word[y][5]);
spi_transfer(scrolling_word[y][4]);
spi_transfer(scrolling_word[y][3]);
spi_transfer(scrolling_word[y][2]);
spi_transfer(scrolling_word[y][1]);
spi_transfer(scrolling_word[y][0]);
latchOn();
delayMicroseconds(800);//a small delay for each row
latchOff();// clearing the shift registers to make sure we will not get a ghosting effect
spi_transfer(0);
spi_transfer(0);
spi_transfer(0);
spi_transfer(0);
spi_transfer(0);
spi_transfer(0);
spi_transfer(0);
latchOn();
// advensing the 4017 counter by one( we just send a positive pulse)
digitalWrite(clock,HIGH);
digitalWrite(clock,LOW);
i++;
}
}
}
}
finish_scroll(delay_langth);// calling for a function to finish scrolling the last 4 symbols
}

void finish_scroll(int delay_scroll){// this function finishs the scrolling and it’s very similar to the display_word function
for (int n=0;n<48;n++){
for(int h=0;h<6;h++){
scrolling_word[h][6] = (scrolling_word[h][6] << 1) | ((scrolling_word[h][5] & 0x80) >> 7);
scrolling_word[h][5] = (scrolling_word[h][5] << 1) | ((scrolling_word[h][4] & 0x80) >> 7);
scrolling_word[h][4] = (scrolling_word[h][4] << 1) | ((scrolling_word[h][3] & 0x80) >> 7);
scrolling_word[h][3] = (scrolling_word[h][3] << 1) | ((scrolling_word[h][2] & 0x80) >> 7);
scrolling_word[h][2] = (scrolling_word[h][2] << 1) | ((scrolling_word[h][1] & 0x80) >> 7);
scrolling_word[h][1] = (scrolling_word[h][1] << 1) | ((scrolling_word[h][0] & 0x80) >> 7);
scrolling_word[h][0] = (scrolling_word[h][0] << 1) | 0 ;
}
for(int t=0;t<delay_scroll;t++){
for(int y=0;y<6;y++){
if(i == 6){
digitalWrite(Reset,HIGH);
digitalWrite(Reset,LOW);
i = 0;
}
latchOff();
spi_transfer(scrolling_word[y][6]);
spi_transfer(scrolling_word[y][5]);
spi_transfer(scrolling_word[y][4]);
spi_transfer(scrolling_word[y][3]);
spi_transfer(scrolling_word[y][2]);
spi_transfer(scrolling_word[y][1]);
spi_transfer(scrolling_word[y][0]);
latchOn();
delayMicroseconds(800);
latchOff();
spi_transfer(0);
spi_transfer(0);
spi_transfer(0);
spi_transfer(0);
spi_transfer(0);
spi_transfer(0);
spi_transfer(0);
latchOn();
digitalWrite(clock,HIGH);
digitalWrite(clock,LOW);
i++;
}
}
}
}

void loop()
{
display_word(1,your_text,8,25);
}

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

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

void setupSPI(){// setting all the registers for SPI cummunication
byte clr;
SPCR |= ( (1<<SPE) | (1<<MSTR) ); // enable SPI as master
//SPCR |= ( (1<<SPR1) | (1<<SPR0) ); // set prescaler bits
SPCR &= ~( (1<<SPR1) | (1<<SPR0) ); // clear prescaler bits
clr=SPSR; // clear SPI status reg
clr=SPDR; // clear SPI data reg

delay(10);
}
byte spi_transfer(byte data)
{
SPDR = data; // Start the transmission
on
{
};
return SPDR; // return the received byte, we don’t need that
}

jika ada pertanyaan silahkan berikan komentar
jika ada problem silahkan berikan komentar
berikan komentar positif membangun

Please follow and like us:
20

2 thoughts on “Led matrix 48×6

  1. I do like the way you have presented this specific challenge plus it really does give us some fodder for thought. Nevertheless, because of what precisely I have witnessed, I basically wish when the actual remarks stack on that people today remain on issue and in no way get started upon a soap box associated with the news of the day. Yet, thank you for this outstanding point and whilst I can not agree with the idea in totality, I value the point of view.

  2. Nice post. I learn something more challenging on different blogs everyday. It will always be stimulating to read content from other writers and practice a little something from their store. I’d prefer to use some with the content on my blog whether you don’t mind. Natually I’ll give you a link on your web blog. Thanks for sharing.

Leave a Reply

Your email address will not be published.