#include <reg52.h>
#define uchar unsigned char
sbit ST_CP=P3^2;
uchar code bmp[108]={ //字模表
0x01,0x00,0x11,0x00,0x11,0x00,0x11,0x00,0x1F,0xF8,0x21,0x00,0x41,0x00,0x01,0x00,0x01,0x00,0xFF,0xFE
,
0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,/*"牛",0*/
0x01,0x00,0x01,0x00,0x11,0xF8,0x11,0x00,0x11,0x00,0x11,0x00,0xFF,0xFE,0x01,0x00,0x01,0x00,0x11,0x08
,
0x11,0x10,0x21,0x20,0x40,0xC0,0x03,0x00,0x1C,0x00,0xE0,0x00,/*"步",1*/0x00,0x00,0x00,0x00,
0x01,0x00,0x01,0x00,0x7F,0xFC,0x01,0x00,0x3F,0xF8,0x01,0x00,0xFF,0xFE,0x00,0x00,0x1F,0xF0,0x10,0x10
,
0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x10,0x10,0x10,0x50,0x10,0x20/*"青",2*/, 0x00,0x00,0x00,0x00
};
void delay(uchar ms) // 延时毫秒@12M,ms最大值255
{
uchar i;
while(ms--)
for(i=0;i<110;i++);
}
void main()
{uchar base,col,p;
while(1)
{
for(base=0;base<=76;base=base+2) //控制移动效果。偶数 32*(8-1)=224;
{
p=34;
while(p--)
for(col=0;col<16;col++) // 显示一个汉字
{
SBUF=bmp[base+col*2];
delay(1);
SBUF=bmp[base+col*2+1];
delay(1);
P1=col;
ST_CP=0; //CP上升沿
ST_CP=1; //移位寄存器的数据进入数据存储寄存
器 delay(1); //延时显示
}
}
}
}
为什么下面串口
通信没SCON
ti 等设置,但是能
仿真成功呢,串口通信可以默认哪种方式,还是?请哪位大神帮忙看看,不胜感激
-
一周热门 更多>