Nguyên văn bởi Multi System
Xem bài viết
các cách lập trình để dk led đơn thì em làm dc rồi
nhưng đến dk led ma tran va led 7 thanh em học mãi mà chả hiểu j
em có đoạn key này cần các anh chỉ giáo
include <at89x52.h>
unsigned char buff[9];
typedef struct
{
unsigned char b[9];
} T_font;
const T_font font[]={
0xFF ,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // dau cach
0x00 ,0xF7,0xF7,0xF7,0xF7,0xF7,0xF7,0x00, // chu H
0x99 ,0x66,0x66,0x66,0x7E,0xBD,0xDB,0xE7, // trai tim
0x00 ,0x66,0x99,0x00,0xDB,0xDB,0xBD,0x7E ,// BK
0xFF ,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // dau cach
0x00 ,0xF7,0xF7,0xF7,0xF7,0xF7,0xF7,0x00, // chu H
0x99 ,0x66,0x66,0x66,0x7E,0xBD,0xDB,0xE7, // trai tim
0x00 ,0x66,0x99,0x00,0xDB,0xDB,0xBD,0x7E ,// BK
0xFF ,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // dau cach
0x00 ,0xF7,0xF7,0xF7,0xF7,0xF7,0xF7,0x00, // chu H
0x99 ,0x66,0x66,0x66,0x7E,0xBD,0xDB,0xE7, // trai tim
0x00 ,0x66,0x99,0x00,0xDB,0xDB,0xBD,0x7E ,// BK
0xFF ,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // dau cach
0x00 ,0xF7,0xF7,0xF7,0xF7,0xF7,0xF7,0x00, // chu H
0x99 ,0x66,0x66,0x66,0x7E,0xBD,0xDB,0xE7, // trai tim
0x00 ,0x66,0x99,0x00,0xDB,0xDB,0xBD,0x7E ,// BK
};
unsigned char i,j;
void delay(unsigned long time)
{
unsigned long k;
for (k=0;k<time;k++) {}
}
void display(unsigned char index)
{
unsigned char i;
for (i=0;i<=7;i++)
{
P1=font[index].b[i];
P2=i;
delay(1);
}
tai sao chữ H lại dc mã hóa là:
0x00 ,0xF7,0xF7,0xF7,0xF7,0xF7,0xF7,0x00,
em ko hiểu j cả
Comment