[DemoCode下载]

8*8点阵字移动显示程序

[复制链接]
772|1
手机看帖
扫描二维码
随时随地手机跟帖
Bermanrep|  楼主 | 2016-3-27 20:28 | 显示全部楼层 |阅读模式
#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
uchar numberx[]={
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07};
uchar numbery[]={
    0x1c,0x14,0x14,0xff,0x14,0x14,0x1c,0x00,
    0xff,0xcb,0xcb,0xff,0xcb,0xeb,0xff,0x00,
    0xff,0x06,0x1b,0x91,0x40,0x3f,0x40,0x80,
    0x84,0x7f,0x84,0xfc,0x3c,0x24,0x3c,0x00,
    0x89,0x52,0xf8,0xa8,0xff,0xa8,0xf8,0x00};
void delay( unsigned int z)
{
int i,j;
for(i=z;i>0;i--)
  for(j=120;j>0;j--);
}
void main()
{ int x,a,b;
while(1)
{
  for(a=0;a<50;a++)
  {
   for(x=0;x<8;x++)
   {
    P0=numberx[x];
    P1=numbery[x+b];
    delay(2);
   }
  }
   b++;
   if(b>32)b=0;
}
}


xuanhuanzi| | 2018-8-15 12:47 | 显示全部楼层
程序真简单,给力。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

22

主题

132

帖子

2

粉丝