change the code :
unsigned char display [1] = {1};
with this :
unsigned char display [1] = {0};
because we only have one character,. if we have 5 character the value is between 0 - 4.
change the code :
unsigned char display [1] = {1};
with this :
unsigned char display [1] = {0};
because we only have one character,. if we have 5 character the value is between 0 - 4.
If I want to scroll the character from to the left ? Do you have idea ? shif [4] 0-3 ?
Of course i have :-D
Now you have understood how to make a static display, for develop it, that's your homework.
My clue, to make animation we have to show and change different pictures fast, like cartoon movie, consider fps.
Keep moving! Good luck.
How can I make only two displayed or for example 0 1 2 3 ? add the font and automatically 4 digits will be displayed ? I don't have those shift register, I need to buy later..Great! You have done it. My advice, to develop high performance display, change 74HC154 with shift register (74164, 4094 or 74HC595), because the brightness of LED will be reduce if you add more columns. For your 8x32 display, each LED only works at 1/32 of full power. If you use shift register, although your display are 8x64,8x128, ... , your display still works at 1/8 of full power.
to display two digits only 1 9 _ _ ( _ = blank ), fill variable with 1, 9, 10, 10
to display two digits only 3 _ 5 _ ( _ = blank ), fill variable with 3, 10, 5, 10
use 11 chars font.
code unsigned char font[88]=
{
// 0 1 2 3 4 5 6 7 8 9 blank
0x3C,0x3C,0x84,0x81,0x10,0x8F,0x60,0x81,0x66,0x46,0x00,
0x42,0x00,0xC2,0x89,0x18,0x89,0x90,0x41,0x99,0x89,0x00,
0xA1,0x00,0xA1,0x89,0x14,0x89,0x98,0x21,0x99,0x89,0x00,
0x91,0xFF,0x91,0x89,0x12,0x89,0x94,0x11,0x99,0x89,0x00,
0x89,0xFF,0x91,0x89,0x11,0x89,0x92,0x09,0x99,0x89,0x00,
0x85,0x06,0x91,0x89,0x11,0x89,0x91,0x05,0x99,0x89,0x00,
0x42,0x04,0x89,0x49,0xFF,0x89,0x90,0x03,0x99,0x89,0x00,
0x3C,0x00,0x86,0x36,0x10,0x71,0x60,0x01,0x66,0x7E,0x00
};
For displaying 0 1 2 3 ?Next time, fix this project first.
Yes.
code unsigned char font[80]=
{
// 0 1 2 3 4 5 6 7 8 9
0x3C,0x3C,0x84,0x81,0x10,0x8F,0x60,0x81,0x66,0x46,
0x42,0x00,0xC2,0x89,0x18,0x89,0x90,0x41,0x99,0x89,
0xA1,0x00,0xA1,0x89,0x14,0x89,0x98,0x21,0x99,0x89,
0x91,0xFF,0x91,0x89,0x12,0x89,0x94,0x11,0x99,0x89,
0x89,0xFF,0x91,0x89,0x11,0x89,0x92,0x09,0x99,0x89,
0x85,0x06,0x91,0x89,0x11,0x89,0x91,0x05,0x99,0x89,
0x42,0x04,0x89,0x49,0xFF,0x89,0x90,0x03,0x99,0x89,
0x3C,0x00,0x86,0x36,0x10,0x71,0x60,0x01,0x66,0x7E
};
unsigned char display [10] = {0,1,2,3,10,10,10,10,10,10};
For displaying 0 1 2 3 ?
Code:code unsigned char font[80]= { // 0 1 2 3 4 5 6 7 8 9 0x3C,0x3C,0x84,0x81,0x10,0x8F,0x60,0x81,0x66,0x46, 0x42,0x00,0xC2,0x89,0x18,0x89,0x90,0x41,0x99,0x89, 0xA1,0x00,0xA1,0x89,0x14,0x89,0x98,0x21,0x99,0x89, 0x91,0xFF,0x91,0x89,0x12,0x89,0x94,0x11,0x99,0x89, 0x89,0xFF,0x91,0x89,0x11,0x89,0x92,0x09,0x99,0x89, 0x85,0x06,0x91,0x89,0x11,0x89,0x91,0x05,0x99,0x89, 0x42,0x04,0x89,0x49,0xFF,0x89,0x90,0x03,0x99,0x89, 0x3C,0x00,0x86,0x36,0x10,0x71,0x60,0x01,0x66,0x7E }; unsigned char display [10] = {0,1,2,3,10,10,10,10,10,10};
code unsigned char font[88]=
{
// 0 1 2 3 4 5 6 7 8 9 10
0x3C,0x3C,0x84,0x81,0x10,0x8F,0x60,0x81,0x66,0x46,0x00,
0x42,0x00,0xC2,0x89,0x18,0x89,0x90,0x41,0x99,0x89,0x00,
0xA1,0x00,0xA1,0x89,0x14,0x89,0x98,0x21,0x99,0x89,0x00,
0x91,0xFF,0x91,0x89,0x12,0x89,0x94,0x11,0x99,0x89,0x00,
0x89,0xFF,0x91,0x89,0x11,0x89,0x92,0x09,0x99,0x89,0x00,
0x85,0x06,0x91,0x89,0x11,0x89,0x91,0x05,0x99,0x89,0x00,
0x42,0x04,0x89,0x49,0xFF,0x89,0x90,0x03,0x99,0x89,0x00,
0x3C,0x00,0x86,0x36,0x10,0x71,0x60,0x01,0x66,0x7E,0x00
};
unsigned char display [4] = {0,1,2,3};
if you want to use 8x8 format, 11 char supported (0-9 and blank), you have to change your font array like this :
Code:code unsigned char font[88]= { // 0 1 2 3 4 5 6 7 8 9 10 0x3C,0x3C,0x84,0x81,0x10,0x8F,0x60,0x81,0x66,0x46,0x00, 0x42,0x00,0xC2,0x89,0x18,0x89,0x90,0x41,0x99,0x89,0x00, 0xA1,0x00,0xA1,0x89,0x14,0x89,0x98,0x21,0x99,0x89,0x00, 0x91,0xFF,0x91,0x89,0x12,0x89,0x94,0x11,0x99,0x89,0x00, 0x89,0xFF,0x91,0x89,0x11,0x89,0x92,0x09,0x99,0x89,0x00, 0x85,0x06,0x91,0x89,0x11,0x89,0x91,0x05,0x99,0x89,0x00, 0x42,0x04,0x89,0x49,0xFF,0x89,0x90,0x03,0x99,0x89,0x00, 0x3C,0x00,0x86,0x36,0x10,0x71,0x60,0x01,0x66,0x7E,0x00 }; unsigned char display [4] = {0,1,2,3};
for (x=0;x<4;x++) //4 characters
.
.
.
a=(y*4)+display[x];
.
.
.
if you want to use 8x8 format, 11 char supported (0-9 and blank), you have to change your font array like this :
Code:code unsigned char font[88]= { // 0 1 2 3 4 5 6 7 8 9 10 0x3C,0x3C,0x84,0x81,0x10,0x8F,0x60,0x81,0x66,0x46,0x00, 0x42,0x00,0xC2,0x89,0x18,0x89,0x90,0x41,0x99,0x89,0x00, 0xA1,0x00,0xA1,0x89,0x14,0x89,0x98,0x21,0x99,0x89,0x00, 0x91,0xFF,0x91,0x89,0x12,0x89,0x94,0x11,0x99,0x89,0x00, 0x89,0xFF,0x91,0x89,0x11,0x89,0x92,0x09,0x99,0x89,0x00, 0x85,0x06,0x91,0x89,0x11,0x89,0x91,0x05,0x99,0x89,0x00, 0x42,0x04,0x89,0x49,0xFF,0x89,0x90,0x03,0x99,0x89,0x00, 0x3C,0x00,0x86,0x36,0x10,0x71,0x60,0x01,0x66,0x7E,0x00 }; unsigned char display [4] = {0,1,2,3};
for (x=0;x<4;x++) //4 characters
{
for (y=0;y<8;y++ ) //each character contains 8 cols.
.
.
.
a=(y*11)+display[x];
void main() {
unsigned char a;
unsigned char x;
unsigned char y;
code unsigned char font[88]=
{
// 0 1 2 3 4 5 6 7 8 9 10
0x3C,0x3C,0x84,0x81,0x10,0x8F,0x60,0x81,0x66,0x46,0x00,
0x42,0x00,0xC2,0x89,0x18,0x89,0x90,0x41,0x99,0x89,0x00,
0xA1,0x00,0xA1,0x89,0x14,0x89,0x98,0x21,0x99,0x89,0x00,
0x91,0xFF,0x91,0x89,0x12,0x89,0x94,0x11,0x99,0x89,0x00,
0x89,0xFF,0x91,0x89,0x11,0x89,0x92,0x09,0x99,0x89,0x00,
0x85,0x06,0x91,0x89,0x11,0x89,0x91,0x05,0x99,0x89,0x00,
0x42,0x04,0x89,0x49,0xFF,0x89,0x90,0x03,0x99,0x89,0x00,
0x3C,0x00,0x86,0x36,0x10,0x71,0x60,0x01,0x66,0x7E,0x00
};
unsigned char display [4] = {0,1,2,3};
do {
for (x=0;x<4;x++) //4 characters
{
for (y=0;y<8;y++ ) //each character contains 6 cols.
{
a=(x*8)+y;
if (a<16) //only for 16 condition (0-15)
{
P2=2; //CS1 and CS2 of 74HC154 chip 1 =0, CS1 and CS2 of 74HC154 chip 2 =1
P1=15-a;
a=(y*11)+display[x];
P3 = font[a];
delay_us(500); //or delay_us(500); try the best view
}
else
{
if (a<32)
{
P2=1; //CS1 and CS2 of 74HC154 chip 1 =1, CS1 and CS2 of 74HC154 chip 2 =0
P1=31-a;
a=(y*11)+display[x];
P3 = font[a];
delay_us(500); //or delay_us(500); try the best view
};
};
};
};
} while(1); // Endless loop
};
Sorry late to reply. I just come from the outside.
Try and watch this code :
Code:void main() { unsigned char a; unsigned char x; unsigned char y; code unsigned char font[88]= { // 0 1 2 3 4 5 6 7 8 9 10 0x3C,0x3C,0x84,0x81,0x10,0x8F,0x60,0x81,0x66,0x46,0x00, 0x42,0x00,0xC2,0x89,0x18,0x89,0x90,0x41,0x99,0x89,0x00, 0xA1,0x00,0xA1,0x89,0x14,0x89,0x98,0x21,0x99,0x89,0x00, 0x91,0xFF,0x91,0x89,0x12,0x89,0x94,0x11,0x99,0x89,0x00, 0x89,0xFF,0x91,0x89,0x11,0x89,0x92,0x09,0x99,0x89,0x00, 0x85,0x06,0x91,0x89,0x11,0x89,0x91,0x05,0x99,0x89,0x00, 0x42,0x04,0x89,0x49,0xFF,0x89,0x90,0x03,0x99,0x89,0x00, 0x3C,0x00,0x86,0x36,0x10,0x71,0x60,0x01,0x66,0x7E,0x00 }; unsigned char display [4] = {0,1,2,3}; do { for (x=0;x<4;x++) //4 characters { for (y=0;y<8;y++ ) //each character contains 6 cols. { a=(x*8)+y; if (a<16) //only for 16 condition (0-15) { P2=2; //CS1 and CS2 of 74HC154 chip 1 =0, CS1 and CS2 of 74HC154 chip 2 =1 P1=15-a; a=(y*11)+display[x]; P3 = font[a]; delay_us(500); //or delay_us(500); try the best view } else { if (a<32) { P2=1; //CS1 and CS2 of 74HC154 chip 1 =1, CS1 and CS2 of 74HC154 chip 2 =0 P1=31-a; a=(y*11)+display[x]; P3 = font[a]; delay_us(500); //or delay_us(500); try the best view }; }; }; }; } while(1); // Endless loop };
Sorry late to reply. I just come from the outside.
Try and watch this code :
Code:void main() { unsigned char a; unsigned char x; unsigned char y; code unsigned char font[88]= { // 0 1 2 3 4 5 6 7 8 9 10 0x3C,0x3C,0x84,0x81,0x10,0x8F,0x60,0x81,0x66,0x46,0x00, 0x42,0x00,0xC2,0x89,0x18,0x89,0x90,0x41,0x99,0x89,0x00, 0xA1,0x00,0xA1,0x89,0x14,0x89,0x98,0x21,0x99,0x89,0x00, 0x91,0xFF,0x91,0x89,0x12,0x89,0x94,0x11,0x99,0x89,0x00, 0x89,0xFF,0x91,0x89,0x11,0x89,0x92,0x09,0x99,0x89,0x00, 0x85,0x06,0x91,0x89,0x11,0x89,0x91,0x05,0x99,0x89,0x00, 0x42,0x04,0x89,0x49,0xFF,0x89,0x90,0x03,0x99,0x89,0x00, 0x3C,0x00,0x86,0x36,0x10,0x71,0x60,0x01,0x66,0x7E,0x00 }; unsigned char display [4] = {0,1,2,3}; do { for (x=0;x<4;x++) //4 characters { for (y=0;y<8;y++ ) //each character contains 6 cols. { a=(x*8)+y; if (a<16) //only for 16 condition (0-15) { P2=2; //CS1 and CS2 of 74HC154 chip 1 =0, CS1 and CS2 of 74HC154 chip 2 =1 P1=15-a; a=(y*11)+display[x]; P3 = font[a]; delay_us(500); //or delay_us(500); try the best view } else { if (a<32) { P2=1; //CS1 and CS2 of 74HC154 chip 1 =1, CS1 and CS2 of 74HC154 chip 2 =0 P1=31-a; a=(y*11)+display[x]; P3 = font[a]; delay_us(500); //or delay_us(500); try the best view }; }; }; }; } while(1); // Endless loop };
for (x=0;x<4;x++) //4 characters
{
for (y=0;y<8;y++ ) //each character contains 8 cols.
{
a=(x*8)+y; // 8 cols
if (a<16) //only for 16 condition (0-15)
{
E1=0;
E2=1;
P1=15-a;
//a=(y*10)+display[x];
a=(y*11)+display[x];
P2 = ~font[a];
delay_100(); //best refresh rate 50 Hz = 20 ms, so for each col = 20/18 ms
//call delay function or make it by yourself
}
else
{
if (a<32)
{
E1=1; //CS1 and CS2 of 74HC154 chip 1
E2=0; //CS1 and CS2 of 74HC154 chip 2
P1=31-a;
//a=(y*10)+display[x];
a=(y*11)+display[x];
P2 = ~font[a];
delay_100(); //or delay_us(500); try the best view
};
[B]unsigned char display [4] = {0,0,0,0};[/B]
for (x=0;x<4;x++) //4 characters
//for (x=0;x<3;x++) //3 characters
{
for (y=0;y<8;y++ ) //each character contains 8 cols.
//for (y=0;y<6;y++ ) //each character contains 6 cols.
{
//a=(x*6)+y;
a=(x*8)+y; // 8 cols
if (a<16) //only for 16 condition (0-15)
{
E1=0;
E2=1;
P1=15-a;
//a=(y*10)+display[x];
a=(y*11)+display[x];
P2 = ~font[a];
delay_100(); //best refresh rate 50 Hz = 20 ms, so for each col = 20/18 ms
//call delay function or make it by yourself
}
else
{
if (a<32)
{
E1=1; //CS1 and CS2 of 74HC154 chip 1
E2=0; //CS1 and CS2 of 74HC154 chip 2
P1=15-a;
//a=(y*10)+display[x];
a=(y*11)+display[x];
P2 = ~font[a];
delay_100(); //or delay_us(500); try the best view
I have tried the my posted program in proteus and it works. please upload your final schematic, so i can see where it missed.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?