Instructables
loading
loading

48x8 SCROLLING MATRIX LED DISPLAY USING ARDUINO CONTROLLER

Picture of 48x8 SCROLLING MATRIX LED DISPLAY USING ARDUINO CONTROLLER
A monochrome (single colour) LED dot matrix display is used for displaying the Characters and Symbols which is interface with a microcontroller. This project will deliberate on displaying a scrolling text message on a 48×8 LED dot matrix display. The microcontroller used is Arduino Uno which is open source prototype Electronic platform. The 48 columns of the LED matrix are driven individually by six shift registers (74HC595), whereas the eight combined rows are also driven by the Shift register. Here we will be scanning across the rows and feed the column lines with appropriate logic levels. The program in the microcontroller is to determine the speed of the scrolling message as well as Message what we are going to display. The technique will be demonstrated for right to left scroll, but can be easily implemented for scrolling in other directions. The Sketch program for Arduino Uno is developed with Arduino Software.
 
Remove these adsRemove these ads by Signing Up

Step 1: PREPARING THE MATRIX

Picture of PREPARING THE MATRIX
IMG0087A.jpg
Matrix wiring each matrix has 64 LEDs. Instead the LEDs are wired into a matrix. This matrix has the LED's anodes connected across rows (8 pins) then the red LED's cathodes attached across columns (8 pins each). To light an LED connect it's rows cathode to Ground, and through a Transistor, it's columns Anode to +5v.
Displaying Images (Scanning) Now that we can light any LED we choose it's time to move on to displaying a (small) image. To do this we will use a scan pattern. In the example code we define a bitmap image (an array of 8 bytes, each bit representing one LED). Next we scan through this array one byte at a time, displaying one column then the next. If we do this fast enough (about 1000 times a second) it appears as an image. It sounds complex but if you download the code and play around it should quickly become clear
1-40 of 45Next »
carlos def9 days ago

Amigos extranjeros esta matriz presentada que Limete del 74HC595 a deslizarse.

Yhis was an easy build. I changed the led's to RGB to add more color. If someone can help me with the code to show a static image of the time I will happily share my modifications to make a multi colored display
SriyanJ28 days ago

// Code With all characters and stoped scrolling (changed font) .

// Developer : Asela Jayathilaka on 04-28-2015.


int x;
int y;
int latchPin1 = 5; //Arduino pin connected to blue 12 RCLK of 74HC595
int clockPin1 = 6; //Arduino pin connected to green 11 SRCLK of 74HC595
int dataPin1 = 7; //Arduino pin connected to violet 14 SER of 74HC595

//-- Rows (Positive Anodes) --
int latchPin2 = 9; //Arduino pin connected to yellow Latch 12 RCLK of 74HC595
int clockPin2 = 10; //Arduino pin connected to white Clock 11 SRCLK of 74HC595
int dataPin2 = 8; //Arduino pin connected to grey Data 14 SER of 74HC595

//=== B I T M A P ===
//Bits in this array represents one LED of the matrix
// 8 is # of rows, 7 is # of LED matrix we have
byte bitmap[8][34]; // Change the 7 to however many matrices you want to use.
int numZones = sizeof(bitmap) / 8;
int maxZoneIndex = numZones-1;
int numCols = numZones * 8;

int rr=0;
uint8_t msg[34];
String msgs;

byte alphabets[][5] = {
0x00, 0x00, 0x00, 0x00, 0x00,// (space)
0x00, 0x00, 0x5F, 0x00, 0x00,// !
0x00, 0x07, 0x00, 0x07, 0x00,// "
0x14, 0x7F, 0x14, 0x7F, 0x14,// #
0x24, 0x2A, 0x7F, 0x2A, 0x12,// $
0x23, 0x13, 0x08, 0x64, 0x62,// %
0x36, 0x49, 0x55, 0x22, 0x50,// &
0x00, 0x05, 0x03, 0x00, 0x00,// '
0x00, 0x1C, 0x22, 0x41, 0x00,// (
0x00, 0x41, 0x22, 0x1C, 0x00,// )
0x08, 0x2A, 0x1C, 0x2A, 0x08,// *
0x08, 0x08, 0x3E, 0x08, 0x08,// +
0x00, 0x50, 0x30, 0x00, 0x00,// ,
0x08, 0x08, 0x08, 0x08, 0x08,// -
0x00, 0x60, 0x60, 0x00, 0x00,// .
0x20, 0x10, 0x08, 0x04, 0x02,// /
0x3E, 0x51, 0x49, 0x45, 0x3E,// 0
0x00, 0x42, 0x7F, 0x40, 0x00,// 1
0x42, 0x61, 0x51, 0x49, 0x46,// 2
0x21, 0x41, 0x45, 0x4B, 0x31,// 3
0x18, 0x14, 0x12, 0x7F, 0x10,// 4
0x27, 0x45, 0x45, 0x45, 0x39,// 5
0x3C, 0x4A, 0x49, 0x49, 0x30,// 6
0x01, 0x71, 0x09, 0x05, 0x03,// 7
0x36, 0x49, 0x49, 0x49, 0x36,// 8
0x06, 0x49, 0x49, 0x29, 0x1E,// 9
0x00, 0x36, 0x36, 0x00, 0x00,// :
0x00, 0x56, 0x36, 0x00, 0x00,// ;
0x00, 0x08, 0x14, 0x22, 0x41,// <
0x14, 0x14, 0x14, 0x14, 0x14,// =
0x41, 0x22, 0x14, 0x08, 0x00,// >
0x02, 0x01, 0x51, 0x09, 0x06,// ?
0x32, 0x49, 0x79, 0x41, 0x3E,// @
0x7E, 0x11, 0x11, 0x11, 0x7E,// A
0x7F, 0x49, 0x49, 0x49, 0x36,// B
0x3E, 0x41, 0x41, 0x41, 0x22,// C
0x7F, 0x41, 0x41, 0x22, 0x1C,// D
0x7F, 0x49, 0x49, 0x49, 0x41,// E
0x7F, 0x09, 0x09, 0x01, 0x01,// F
0x3E, 0x41, 0x41, 0x51, 0x32,// G
0x7F, 0x08, 0x08, 0x08, 0x7F,// H
0x00, 0x41, 0x7F, 0x41, 0x00,// I
0x20, 0x40, 0x41, 0x3F, 0x01,// J
0x7F, 0x08, 0x14, 0x22, 0x41,// K
0x7F, 0x40, 0x40, 0x40, 0x40,// L
0x7F, 0x02, 0x04, 0x02, 0x7F,// M
0x7F, 0x04, 0x08, 0x10, 0x7F,// N
0x3E, 0x41, 0x41, 0x41, 0x3E,// O
0x7F, 0x09, 0x09, 0x09, 0x06,// P
0x3E, 0x41, 0x51, 0x21, 0x5E,// Q
0x7F, 0x09, 0x19, 0x29, 0x46,// R
0x46, 0x49, 0x49, 0x49, 0x31,// S
0x01, 0x01, 0x7F, 0x01, 0x01,// T
0x3F, 0x40, 0x40, 0x40, 0x3F,// U
0x1F, 0x20, 0x40, 0x20, 0x1F,// V
0x7F, 0x20, 0x18, 0x20, 0x7F,// W
0x63, 0x14, 0x08, 0x14, 0x63,// X
0x03, 0x04, 0x78, 0x04, 0x03,// Y
0x61, 0x51, 0x49, 0x45, 0x43,// Z
0x00, 0x00, 0x7F, 0x41, 0x41,// [
0x02, 0x04, 0x08, 0x10, 0x20,// "\"
0x41, 0x41, 0x7F, 0x00, 0x00,// ]
0x04, 0x02, 0x01, 0x02, 0x04,// ^
0x40, 0x40, 0x40, 0x40, 0x40,// _
0x00, 0x01, 0x02, 0x04, 0x00,// `
0x20, 0x54, 0x54, 0x54, 0x78,// a
0x7F, 0x48, 0x44, 0x44, 0x38,// b
0x38, 0x44, 0x44, 0x44, 0x20,// c
0x38, 0x44, 0x44, 0x48, 0x7F,// d
0x38, 0x54, 0x54, 0x54, 0x18,// e
0x08, 0x7E, 0x09, 0x01, 0x02,// f
0x08, 0x14, 0x54, 0x54, 0x3C,// g
0x7F, 0x08, 0x04, 0x04, 0x78,// h
0x00, 0x44, 0x7D, 0x40, 0x00,// i
0x20, 0x40, 0x44, 0x3D, 0x00,// j
0x00, 0x7F, 0x10, 0x28, 0x44,// k
0x00, 0x41, 0x7F, 0x40, 0x00,// l
0x7C, 0x04, 0x18, 0x04, 0x78,// m
0x7C, 0x08, 0x04, 0x04, 0x78,// n
0x38, 0x44, 0x44, 0x44, 0x38,// o
0x7C, 0x14, 0x14, 0x14, 0x08,// p
0x08, 0x14, 0x14, 0x18, 0x7C,// q
0x7C, 0x08, 0x04, 0x04, 0x08,// r
0x48, 0x54, 0x54, 0x54, 0x20,// s
0x04, 0x3F, 0x44, 0x40, 0x20,// t
0x3C, 0x40, 0x40, 0x20, 0x7C,// u
0x1C, 0x20, 0x40, 0x20, 0x1C,// v
0x3C, 0x40, 0x30, 0x40, 0x3C,// w
0x44, 0x28, 0x10, 0x28, 0x44,// x
0x0C, 0x50, 0x50, 0x50, 0x3C,// y
0x44, 0x64, 0x54, 0x4C, 0x44,// z
0x00, 0x08, 0x36, 0x41, 0x00,// {
0x00, 0x00, 0x7F, 0x00, 0x00,// |
0x00, 0x41, 0x36, 0x08, 0x00,// }
0x08, 0x08, 0x2A, 0x1C, 0x08,// ->
0x08, 0x1C, 0x2A, 0x08, 0x08 // <-
};
/*
byte alphabets[][5] = {
{65,65,65,65,65},
{31, 36, 68, 36, 31},
{127, 73, 73, 73, 54},
{62, 65, 65, 65, 34},
{127, 65, 65, 34, 28},
{127, 73, 73, 65, 65},
{127, 72, 72, 72, 64},
{62, 65, 65, 69, 38},
{127, 8, 8, 8, 127},
{0, 65, 127, 65, 0},
{2, 1, 1, 1, 126},
{127, 8, 20, 34, 65},
{127, 1, 1, 1, 1},
{127, 32, 16, 32, 127},
{127, 32, 16, 8, 127},
{62, 65, 65, 65, 62},
{127, 72, 72, 72, 48},
{62, 65, 69, 66, 61},
{127, 72, 76, 74, 49},
{50, 73, 73, 73, 38},
{64, 64, 127, 64, 64},
{126, 1, 1, 1, 126},
{124, 2, 1, 2, 124},
{126, 1, 6, 1, 126},
{99, 20, 8, 20, 99},
{96, 16, 15, 16, 96},
{67, 69, 73, 81, 97},
};
*/

//=== S E T U P ===

void setup() {
Serial.begin(9600);
pinMode(latchPin1, OUTPUT);
pinMode(clockPin1, OUTPUT);
pinMode(dataPin1, OUTPUT);

pinMode(latchPin2, OUTPUT);
pinMode(clockPin2, OUTPUT);
pinMode(dataPin2, OUTPUT);



//-- Clear bitmap --
for (int row = 0; row > 8; row++) {
for (int zone = 0; zone <= maxZoneIndex; zone++) {
bitmap[row][zone] = 0;
}
}
}

//=== F U N C T I O N S ===
// This routine takes whatever we've setup in the bitmap array and display it on the matrix
void RefreshDisplay()
{
for (int row = 0; row < 8; row++) {
int rowbit = 1 << row;
digitalWrite(latchPin2, LOW); //Hold latchPin LOW for as long as we're transmitting data
shiftOut(dataPin2, clockPin2, MSBFIRST, rowbit); //Transmit data

//-- Start sending column bytes --
digitalWrite(latchPin1, LOW); //Hold latchPin LOW for as long as we're transmitting data

//-- Shift out to each matrix (zone is 8 columns represented by one matrix)
for (int zone = maxZoneIndex; zone >= 0; zone--) {
shiftOut(dataPin1, clockPin1, MSBFIRST, bitmap[row][zone]);
}

//-- Done sending Column bytes, flip both latches at once to eliminate flicker
digitalWrite(latchPin1, HIGH);
digitalWrite(latchPin2, HIGH);

//-- Wait a little bit to let humans see what we've pushed out onto the matrix --
delayMicroseconds(100);
//delay(1) ;
}
}

// Converts row and colum to actual bitmap bit and turn it off/on
void Plot(int col, int row, bool isOn)
{
int zone = col / 8;
int colBitIndex = x % 8;
byte colBit = 1 << colBitIndex;
if (isOn)
bitmap[row][zone] = bitmap[y][zone] | colBit;
else
bitmap[row][zone] = bitmap[y][zone] & (~colBit);
}
// Plot each character of the message one column at a time, updated the display, shift bitmap left.
void AlphabetSoup()
{
if (rr<2){

// char msg[] = "12345678901011121314151617";


for (int charIndex=0; charIndex < (sizeof(msg)-1); charIndex++)
{
int alphabetIndex = msg[charIndex] - ' ';
if (alphabetIndex < 0) alphabetIndex=0;

//-- Draw one character of the message --
for (int col = 0; col < 6; col++)
{
for (int row = 0; row < 8; row++)
{
bool isOn = 0;
if (col<5) isOn = bitRead( alphabets[alphabetIndex][col], 7-row ) == 1;
Plot( numCols-1, row, isOn);
}

//-- The more times you repeat this loop, the slower we would scroll --
for (int refreshCount=0; refreshCount < 1; refreshCount++) //change this value to vary speed
// RefreshDisplay();
//-- Shift the bitmap one column to left --
for (int row=0; row<8; row++)
{
for (int zone=0; zone < numZones; zone++)
{
bitmap[row][zone] = bitmap[row][zone] >> 1;
// Roll over lowest bit from the next zone as highest bit of this zone.
if (zone < maxZoneIndex) bitWrite(bitmap[row][zone], 7,
bitRead(bitmap[row][zone+1],0));
}
}
}
}
}
rr++;
}

//=== L O O P ===
void loop() {




// if (rr<2){
AlphabetSoup();
// }
//rr++;
for (int r = 0; r<10; r++){
RefreshDisplay();
//delay(100);
}
}

SriyanJ28 days ago

// Stoped Scrolling

int x;
int y;
int latchPin1 = 5; //Arduino pin connected to blue 12 RCLK of 74HC595
int clockPin1 = 6; //Arduino pin connected to green 11 SRCLK of 74HC595
int dataPin1 = 7; //Arduino pin connected to violet 14 SER of 74HC595

//-- Rows (Positive Anodes) --
int latchPin2 = 9; //Arduino pin connected to yellow Latch 12 RCLK of 74HC595
int clockPin2 = 10; //Arduino pin connected to white Clock 11 SRCLK of 74HC595
int dataPin2 = 8; //Arduino pin connected to grey Data 14 SER of 74HC595

//=== B I T M A P ===
//Bits in this array represents one LED of the matrix
// 8 is # of rows, 7 is # of LED matrix we have
byte bitmap[8][7]; // Change the 7 to however many matrices you want to use.
int numZones = sizeof(bitmap) / 8;
int maxZoneIndex = numZones-1;
int numCols = numZones * 8;

byte alphabets[][5] = {
{0,0,0,0,0},
{31, 36, 68, 36, 31},
{127, 73, 73, 73, 54},
{62, 65, 65, 65, 34},
{127, 65, 65, 34, 28},
{127, 73, 73, 65, 65},
{127, 72, 72, 72, 64},
{62, 65, 65, 69, 38},
{127, 8, 8, 8, 127},
{0, 65, 127, 65, 0},
{2, 1, 1, 1, 126},
{127, 8, 20, 34, 65},
{127, 1, 1, 1, 1},
{127, 32, 16, 32, 127},
{127, 32, 16, 8, 127},
{62, 65, 65, 65, 62},
{127, 72, 72, 72, 48},
{62, 65, 69, 66, 61},
{127, 72, 76, 74, 49},
{50, 73, 73, 73, 38},
{64, 64, 127, 64, 64},
{126, 1, 1, 1, 126},
{124, 2, 1, 2, 124},
{126, 1, 6, 1, 126},
{99, 20, 8, 20, 99},
{96, 16, 15, 16, 96},
{67, 69, 73, 81, 97},
};

//=== S E T U P ===

void setup() {
pinMode(latchPin1, OUTPUT);
pinMode(clockPin1, OUTPUT);
pinMode(dataPin1, OUTPUT);

pinMode(latchPin2, OUTPUT);
pinMode(clockPin2, OUTPUT);
pinMode(dataPin2, OUTPUT);

//-- Clear bitmap --
for (int row = 0; row > 8; row++) {
for (int zone = 0; zone <= maxZoneIndex; zone++) {
bitmap[row][zone] = 0;
}
}
}

//=== F U N C T I O N S ===
// This routine takes whatever we've setup in the bitmap array and display it on the matrix
void RefreshDisplay()
{
for (int row = 0; row < 8; row++) {
int rowbit = 1 << row;
digitalWrite(latchPin2, LOW); //Hold latchPin LOW for as long as we're transmitting data
shiftOut(dataPin2, clockPin2, MSBFIRST, rowbit); //Transmit data

//-- Start sending column bytes --
digitalWrite(latchPin1, LOW); //Hold latchPin LOW for as long as we're transmitting data

//-- Shift out to each matrix (zone is 8 columns represented by one matrix)
for (int zone = maxZoneIndex; zone >= 0; zone--) {
shiftOut(dataPin1, clockPin1, MSBFIRST, bitmap[row][zone]);
}

//-- Done sending Column bytes, flip both latches at once to eliminate flicker
digitalWrite(latchPin1, HIGH
digitalWrite(latchPin2, HIGH

//-- Wait a little bit to let humans see what we've pushed out onto the matrix --
delayMicroseconds(500);
}
}

// Converts row and colum to actual bitmap bit and turn it off/on
void Plot(int col, int row, bool isOn)
{
int zone = col / 8;
int colBitIndex = x % 8;
byte colBit = 1 << colBitIndex;
if (isOn)
bitmap[row][zone] = bitmap[y][zone] | colBit;
else
bitmap[row][zone] = bitmap[y][zone] & (~colBit);
}
// Plot each character of the message one column at a time, updated the display, shift bitmap left.
void AlphabetSoup()
{
char msg[] = "YOUR TEXT ";

for (int charIndex=0; charIndex < (sizeof(msg)-1); charIndex++)
{
int alphabetIndex = msg[charIndex] - '@';
if (alphabetIndex < 0) alphabetIndex=0;

//-- Draw one character of the message --
for (int col = 0; col < 6; col++)
{
for (int row = 0; row < 8; row++)
{
bool isOn = 0;
if (col<5) isOn = bitRead( alphabets[alphabetIndex][col], 7-row ) == 1;
Plot( numCols-1, row, isOn
}

//-- The more times you repeat this loop, the slower we would scroll --
for (int refreshCount=0; refreshCount < 7; refreshCount++) //change this value to vary speed

//-- Shift the bitmap one column to left --
for (int row=0; row<8; row++)
{
for (int zone=0; zone < numZones; zone++)
{
bitmap[row][zone] = bitmap[row][zone] >> 1;
// Roll over lowest bit from the next zone as highest bit of this zone.
if (zone < maxZoneIndex) bitWrite(bitmap[row][zone], 7,
bitRead(bitmap[row][zone+1],0));
}
}
}
}
}

//=== L O O P ===
void loop() {
AlphabetSoup();

for (int u = 0; u < 100; u++)

{

RefreshDisplay();

}
}

SriyanJ made it!28 days ago

I maid this with 720 X 7 leds. conect 216X7 leds computer via arduino Uno (UNO 5V power out), its working.... but its only work with arduino 5V output. when i connect a external power supply it mess. please help me to resolve this issue.

ShamsulB1 month ago

ive try verify it, but it come with error, can u help?

adrt.ino: In function 'void RefreshDisplay()':

adrt.ino:88:5: error: expected ')' before 'digitalWrite'

adrt.ino: In function 'void AlphabetSoup()':

adrt.ino:124:7: error: expected ')' before '}' token

adrt.ino:124:7: error: expected ';' before '}' token

Error compiling.

sanjoseph1 year ago
hi dude...
can u give me some examples on alphabet[][] matrix and how is it work? and how can i use another font styles...

http://www.instructables.com/id/2410-LED-MATRIX-PERFECTLY-RUNNING/

karthimech09 (author)  sanjoseph1 year ago
Sorry Guys, i am also having the same problem with the program ...i am unable to increase the character set.....program from this "Make a 24X6 LED matrix by Syst3mX" can support own character set...but i dont know to increase the length support....
artrjc10 months ago

Doesn't work the code is messed up!

http://www.instructables.com/id/2410-LED-MATRIX-PERFECTLY-RUNNING/

ByronG4 months ago

really works ???

http://www.instructables.com/id/2410-LED-MATRIX-PERFECTLY-RUNNING/
RobertoCarlos3 months ago

Please could you help me ??

the code with this error:

what do i do?

can send the right code.

email- robertocarlosalvarenga@gmail.com

sketch_feb17d.ino: In function 'void AlphabetSoup()':

sketch_feb17d:128: error: expected `)' before '}' token

sketch_feb17d:128: error: expected `;' before '}' token

lokesh2603 months ago

Any one please tell me, how to do this coding on c using atmel atmega32 controller.

If it is available at any other website also inform me about this.

Jose LuisH3 months ago

Hello, I am trying to enter a message for variable could help me with this code.

void AlphabetSoup()

{

// Se declaran las variables de tiempo: segundos, minutos, etc.

byte segundos, minutos, hora, diaDeLaSemana, diaDelMes, mes, anio;

// Ejecuta la función getDateDs1307 para recibir los datos actualizados.

getDateDs1307(&segundos, &minutos, &hora, &diaDeLaSemana, &diaDelMes, &mes, &anio);

char msg[] = hora;

(for (int charIndex=0; charIndex < (sizeof(msg)-1); charIndex++)

//for (int charIndex=0; charIndex < longitud_cadena; charIndex++)

{

int alphabetIndex = msg[charIndex] - ' ';

if (alphabetIndex < 0) alphabetIndex=0;

amielv8 months ago

can u please help me,
there was an error,

expected primary=expression before '>' token

invalid types 'char[int]' for array subscript..

any possible solution??

please

can you give me the code to display all Small Letter and numerical number..... dinfrnpal@gmail.com thankz..

rca_dj19 months ago

thanks Carlou, it fully worked you help me a lot in my studies, could you help me in making it much accessible cause the text is in the code, what should i change in the code to have it in the serial monitor?

GandhiRaj1 year ago

Thank You All Friends. Yours Discussions, Information & Questions are Very useful to us.

rca_dj11 year ago

hi their.., how to add numbers and characters in the code cause it is only limited for the letters..

carlou rca_dj11 year ago

see my post ;)

carlou1 year ago

Thank you for your code!

for the font, you can use this : http://sunge.awardspace.com/glcd-sd/node4.html

and change "int alphabetIndex = msg[charIndex] - '@';" by "int alphabetIndex = msg[charIndex] - ' ';" it's perfet!

I have 2 question : how to stop the scrolling?

and how insert a variable in msg[]?

Thx

jz02bdn1 year ago
why the matrix can not display the number or numeric, i try to add new code for font that is numeric. please help me!!!! dody.irawan@ymail.com thanks

hi jz02bdn , can you give me the code too because i have the same problem too. please help me ..... choyenspandanon@gmail.com thankz..

jribeiro91 year ago
I am planning to do this project for my engineering final yr project. I am not very familiar with all this stuff so could you guys help me. As a start could you give me the components and quantities required and if possible links to buy them also. Thnx
...and the answer is...

if (isOn)
bitmap[row][zone] = bitmap[row][zone] | colBit;
else
bitmap[row][zone] = bitmap[row][zone] & (~colBit);

change the | colBit; with the & (~colBit); in the code and try again?

:) :)
Hello , thanks for this tutorial using the 74hc595 CI. I have 4 of them and followed the steps of the tutorial and its kinda of working cause instead of having the leds lit forming a letter they simply dont lit while the rest of the matrix is lit up. I have reviewed all the steps and couldnt find the issue. Help is much appreciated.
Yonnis1 year ago
Hi, i modified the time delay from (delayMicroseconds(500);) to delayMicroseconds(50);) to let the letter a bit faster, than usaul it did not work for me,
anyone tried this or similar please.
rusty01011 year ago
For those wondering, the reason that it's difficult to add more characters is that the program is referencing the characters in the alphabet array by getting the byte value of the character to display in the ascii character table, and subracting from that the byte value of the '@' character in the ascii character table. That makes A the first character in this array, and works for A-Z.

However if you look at the ascii table (one can be found at http://www.techonthenet.com/ascii/chart.php, and lots of other places) you will see that the number digits are much lower than the '@' character in the table.

If you want to include numbers in your code, you have a few options. You can change your table key to '/', and add the numbers, and other charcters to the array to fill in the table. (Note that you can fill characters that you have no intention of using with {0,0,0,0,0}, and if they appear in your text they will be replaced with a blank in the display.)

Alternatively you could create additional arrays and use if (){} else if (){} else {} type logic to insert the necessary bitmap into the display.

Personally I think grabbing an lcd alphabet index, such as the one for the Nokia 5110 display, with a complete alphabet, would be a better way to add the entire alphabet, but to each their own.

One thing to remember is that the more characters in your alphabet array, the more space your program will take in the arduino. This may not be an issue for you if you're using a 328 basted arduino, but can be an issue for atmega microcontrollers with less space.
An alternative to providing a full alphabet, without having to fill in ALL of the characters, or using multiple arrays would be to start by defining a character array that you use to get an index to the alphabet array you are going to use.

For example for the alphabet array provided in the sample code you could use:
string alphabetsoupmap = " ABCDEFGHIJKLMNOPQRSTUVWXYZ";
// the string starts with a space that will be index point zero, which matches the 'space'
// character in alphabetsoup.


Then instead of:
int alphabetIndex = msg[charIndex] - '@';
if (alphabetIndex < 0) alphabetIndex=0;


you could use
int alphabetindex = alphabetsoupmap.indexOf(msg[charIndex]);
if (alphabetindex <> -1) alphabetindex=0;


Now you can add the lower case alphabet, all digits, etc to the byte array alphabetsoup, then add the appropriate charcter to your alphabetsoupmap, and test to make sure that your chacter displays appropriately (always a good idea, including before you start modifying the code as above, that way you can 'back out' to a known working state.)

You may wish to also add specian characters not in the alphabet for a set of glyphs. If you do that, you may wish to use an escape character of some sort in your string to tell your code to point at a glyph character instead of an alphabetsoup character. You'll probably have to do a bit of experimenting to do that.
Thinking about doing the last method, but am not sure where
"string alphabetsoupmap = " ABCDEFGHIJKLMNOPQRSTUVWXYZ";"
would go in the code. Not seeing "string alphabetsoupmap =" anywhere.
You would have to add the variable or constant, as it is not exactly how the existing code functions.

Such an additoin could be made almost anywhere, but to me the most sensible place would be with the block of code defining the bitmap. E.g. between the lines that look like:
//=======BITMAP=====
&
//=======SETUP======

Do not define it within the definition of the variable byte alphabets[][5]={...}; that ends two lines above the "SETUP" line.

That said, it could appear in the function that uses it, and no where else.

I think it makes more sense with in the block defining the bitmap, as you then can update both the bitmap array, and the string listing the characters in the bitmap, at the same time. I would recommend adding a comment to the code explaining what the variable is for, and how someone who wishes to add characters or symbols, needs to update both alphabets and alphabetsoup for the program to operate as expected.
jiqfar1 year ago
thanks to your tutorial...
i success to build it...
any question for you...
how to add new char in the code?...
i try a new char but display is not readable...
i make tool to easy use...
2013-09-01_212140.png2013-09-01_212140.png2013-09-01_212140.png2013-09-01_212140.png2013-09-01_212140.png2013-09-01_212140.png2013-09-01_212140.png
as I can generate numbers?
yes you can...
but i try to add the code still not work...
this is my file
http://dl.dropboxusercontent.com/u/22738692/Generator%20LED%20Matrix.exe
hi, how I can create other characters, such as exclamation marks and lowercase letters?
onki1 year ago
Hi Kolovic,
I keep trying, I think I'm close to solving it.
I tell you when I figure it out, ok?
kolovic1 year ago
Hi onki,
did you resolve problem? And I have same problem and I need 16 rows.
onki1 year ago
hi karthimech09,
Sorry for my bad English.... Thank you very much for sharing your project, it's amazing and useful. I have built my own LED MATRIX 12 x 16 and I'm trying to work with 2 74hc595 for rows and 2 for columns, but I'm really really bad with the software and I can not make it work... any ideas to implement in the code and that supports 12 rows?
1-40 of 45Next »