[DemoCode下载] 8*8点阵字移动显示程序

[复制链接]
1056|1
 楼主| Bermanrep 发表于 2016-3-27 20:28 | 显示全部楼层 |阅读模式
  1. #include<reg52.h>
  2. #define uchar unsigned char
  3. #define uint unsigned int
  4. uchar numberx[]={
  5. 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07};
  6. uchar numbery[]={
  7.     0x1c,0x14,0x14,0xff,0x14,0x14,0x1c,0x00,
  8.     0xff,0xcb,0xcb,0xff,0xcb,0xeb,0xff,0x00,
  9.     0xff,0x06,0x1b,0x91,0x40,0x3f,0x40,0x80,
  10.     0x84,0x7f,0x84,0xfc,0x3c,0x24,0x3c,0x00,
  11.     0x89,0x52,0xf8,0xa8,0xff,0xa8,0xf8,0x00};
  12. void delay( unsigned int z)
  13. {
  14. int i,j;
  15. for(i=z;i>0;i--)
  16.   for(j=120;j>0;j--);
  17. }
  18. void main()
  19. { int x,a,b;
  20. while(1)
  21. {
  22.   for(a=0;a<50;a++)
  23.   {
  24.    for(x=0;x<8;x++)
  25.    {
  26.     P0=numberx[x];
  27.     P1=numbery[x+b];
  28.     delay(2);
  29.    }
  30.   }
  31.    b++;
  32.    if(b>32)b=0;
  33. }
  34. }


xuanhuanzi 发表于 2018-8-15 12:47 | 显示全部楼层
程序真简单,给力。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

22

主题

132

帖子

2

粉丝
快速回复 在线客服 返回列表 返回顶部