找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 1647|回复: 0
打印 上一主题 下一主题
收起左侧

单片机c51流水灯程序

[复制链接]
跳转到指定楼层
楼主
ID:419297 发表于 2018-11-1 19:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
#include<at89x51.h>
unsigned char x[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
unsigned char y[]={
0x08,0x38,0x08,0x08,0x08,0x08,0x7e,0x00,//1
0x00,0x3c,0x04,0x3c,0x20,0x20,0x3c,0x00,//2
0x00,0x3c,0x04,0x04,0x3c,0x04,0x04,0x3c,//3
0x00,0x28,0x28,0x28,0x34,0x08,0x08,0x00,//4
0x00,0x3c,0x20,0x3c,0x04,0x04,0x3c,0x00,//5
0x00,0x3c,0x20,0x20,0x3c,0x24,0x24,0x3c,//6
0x00,0x3c,0x04,0x04,0x04,0x04,0x04,0x00,//7
0x00,0x3c,0x24,0x24,0x3c,0x24,0x24,0x3c,//8
0x00,0x3c,0x24,0x24,0x3c,0x04,0x04,0x3c,//9
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
z(int x)
{
  int i,j;
  for(i=0;i<x;i++)
  for(j=0;j<120;j++);
}
main()
{
  int a,n,m;
  while(1)
  {
   for(a=0;a<10;a++)
   {
    for(n=0;n<8;n++)
{
  P1=x[n];
  P3=~y[m+n];
  z(2);
}
   }
   m=m+1;
   if(m>71)
   m=0;
  
  }


}
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏1 分享淘帖 顶 踩
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表