请教大虾帮我写个单片机led汉字显示的程序,16*16点阵 我用字模软件提取了 “邵军平”这三个字的代码
字模软件是横扫描的,三个字的代码分别为邵:DB02H,00H,FFH,FCH,22H,84H,22H,84H,22H,88H,42H,88H,4AH,90H,84H,88...
字模软件是横扫描的,三个字的代码分别为
邵:DB 02H,00H,FFH,FCH,22H,84H,22H,84H,22H,88H,42H,88H,4AH,90H,84H,88H,
02H,84H,7FH,82H,42H,C2H,42H,A2H,42H,94H,7EH,88H,42H,80H,00H,80H
军:DB 00H,00H,7FH,FEH,42H,02H,82H,14H,3FH,F8H,04H,00H,09H,00H,11H,10H,
3FH,F8H,01H,00H,01H,04H,FFH,FEH,01H,00H,01H,00H,01H,00H,01H,00H
平:DB 00H,08H,7FH,FCH,01H,00H,11H,10H,11H,10H,09H,20H,09H,20H,01H,04H,
FFH,FEH,01H,00H,01H,00H,01H,00H,01H,00H,01H,00H,01H,00H,01H,00H
如果有高人指点或者相救,本人不胜感激。邮箱为 317662831@qq.com
请用汇编语言!! 展开
邵:DB 02H,00H,FFH,FCH,22H,84H,22H,84H,22H,88H,42H,88H,4AH,90H,84H,88H,
02H,84H,7FH,82H,42H,C2H,42H,A2H,42H,94H,7EH,88H,42H,80H,00H,80H
军:DB 00H,00H,7FH,FEH,42H,02H,82H,14H,3FH,F8H,04H,00H,09H,00H,11H,10H,
3FH,F8H,01H,00H,01H,04H,FFH,FEH,01H,00H,01H,00H,01H,00H,01H,00H
平:DB 00H,08H,7FH,FCH,01H,00H,11H,10H,11H,10H,09H,20H,09H,20H,01H,04H,
FFH,FEH,01H,00H,01H,00H,01H,00H,01H,00H,01H,00H,01H,00H,01H,00H
如果有高人指点或者相救,本人不胜感激。邮箱为 317662831@qq.com
请用汇编语言!! 展开
2个回答
展开全部
你的字模式汇编的,自己改成C的自模吧,然后放在下面的函数中
本人Q547078724
51学习群128226578
#include <reg52.h>
#define int8 unsigned char
#define int16 unsigned int
#define int32 unsigned long
int8 flag;
int8 n;
int8 code table[][32]={
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/* " " */
{0x04,0x28,0x08,0x24,0x32,0x22,0xC2,0x21,0xC2,0x26,0x34,0x38,0x04,0x04,0x08,0x18,0x30,0xF0,0xC0,0x17,0x60,0x10,0x18,0x10,0x0C,0x14,0x06,0x18,0x04,0x10,0x00,0x00},/*"欢",0*/
{0x02,0x02,0x04,0x82,0xF8,0x73,0x04,0x20,0x02,0x00,0xE2,0x3F,0x42,0x20,0x82,0x40,0x02,0x40,0xFA,0x3F,0x02,0x20,0x42,0x20,0x22,0x20,0xC2,0x3F,0x02,0x00,0x00,0x00},/*"迎",1*/
{0x00,0x01,0x04,0x02,0x1C,0x0C,0xC0,0x3F,0x1C,0xC0,0x02,0x09,0x02,0x16,0x92,0x60,0x4A,0x20,0x82,0x2F,0x02,0x20,0x0E,0x24,0x00,0x22,0x90,0x31,0x0C,0x20,0x00,0x00},/*"您",2*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/* " " */
};
void delay(void);
int16 offset;
void main(void)
{
int8 i;
int8 *p;
flag=0x10;
n=0;
TMOD=0x01;
TH0=0xb1;
TL0=0xe0;
ET0=1;
EA=1;
TR0=1;
p=&table[0][0];
while (1)
{
for (i=0;i<8;i++) //显示左半边屏幕
{
P0=*(p+offset+2*i);
P2=i|0x08; //P2.4=0,P2.3=1 选中U2, 输出扫描码给U6
delay();
P0=*(p+offset+2*i+1);
P2=i|0x10; //P2.4=1,P2.3=0 选中U3, 输出扫描码给U7
delay();
}
for (i=8;i<16;i++) //显示右半边屏幕
{
P0=*(p+offset+2*i);
P2=(i-8)|0x20; //P2.5=1 P2.4=0, P2.3=0 选中U4,输出扫描码U8
delay();
P0=*(p+offset+2*i+1);
P2=(i-8)|0x40; //P2.6=1 P2.5=0, P2.4=0 选中U5,输出扫描码U9
delay();
}
}
}
void delay(void)
{
int16 i;
for (i=0;i<50;i++)
;
}
void timer0() interrupt 1 using 3
{
TF0=0;
TH0=0xb1;
TL0=0xe0;
if (n<10)
{
n++; //n=n+1
}
else
{
offset+=2; //offset=offset+2
if (offset>128)
offset=0;
n=0;
}
本人Q547078724
51学习群128226578
#include <reg52.h>
#define int8 unsigned char
#define int16 unsigned int
#define int32 unsigned long
int8 flag;
int8 n;
int8 code table[][32]={
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/* " " */
{0x04,0x28,0x08,0x24,0x32,0x22,0xC2,0x21,0xC2,0x26,0x34,0x38,0x04,0x04,0x08,0x18,0x30,0xF0,0xC0,0x17,0x60,0x10,0x18,0x10,0x0C,0x14,0x06,0x18,0x04,0x10,0x00,0x00},/*"欢",0*/
{0x02,0x02,0x04,0x82,0xF8,0x73,0x04,0x20,0x02,0x00,0xE2,0x3F,0x42,0x20,0x82,0x40,0x02,0x40,0xFA,0x3F,0x02,0x20,0x42,0x20,0x22,0x20,0xC2,0x3F,0x02,0x00,0x00,0x00},/*"迎",1*/
{0x00,0x01,0x04,0x02,0x1C,0x0C,0xC0,0x3F,0x1C,0xC0,0x02,0x09,0x02,0x16,0x92,0x60,0x4A,0x20,0x82,0x2F,0x02,0x20,0x0E,0x24,0x00,0x22,0x90,0x31,0x0C,0x20,0x00,0x00},/*"您",2*/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},/* " " */
};
void delay(void);
int16 offset;
void main(void)
{
int8 i;
int8 *p;
flag=0x10;
n=0;
TMOD=0x01;
TH0=0xb1;
TL0=0xe0;
ET0=1;
EA=1;
TR0=1;
p=&table[0][0];
while (1)
{
for (i=0;i<8;i++) //显示左半边屏幕
{
P0=*(p+offset+2*i);
P2=i|0x08; //P2.4=0,P2.3=1 选中U2, 输出扫描码给U6
delay();
P0=*(p+offset+2*i+1);
P2=i|0x10; //P2.4=1,P2.3=0 选中U3, 输出扫描码给U7
delay();
}
for (i=8;i<16;i++) //显示右半边屏幕
{
P0=*(p+offset+2*i);
P2=(i-8)|0x20; //P2.5=1 P2.4=0, P2.3=0 选中U4,输出扫描码U8
delay();
P0=*(p+offset+2*i+1);
P2=(i-8)|0x40; //P2.6=1 P2.5=0, P2.4=0 选中U5,输出扫描码U9
delay();
}
}
}
void delay(void)
{
int16 i;
for (i=0;i<50;i++)
;
}
void timer0() interrupt 1 using 3
{
TF0=0;
TH0=0xb1;
TL0=0xe0;
if (n<10)
{
n++; //n=n+1
}
else
{
offset+=2; //offset=offset+2
if (offset>128)
offset=0;
n=0;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询