找回密码
 立即注册

QQ登录

只需一步,快速开始

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

51单片机控制64位流水灯程序电路原理图

[复制链接]
跳转到指定楼层
楼主
#include<reg51.h>

const unsigned char P0_arry[8]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};
//const unsigned char P0_arry[8]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
//const unsigned char P2_arry[8]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
const unsigned char P2_arry[8]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};
void delay(unsigned int time)
{
    unsigned int i, j;
    for(i = 0; i < time; i++)
        for(j = 0; j < 120; j++);
}
void main()
{
  unsigned char i, j;

        while(1)
        {
                for(i=0;i<8;i++)
                {
                        P2 = P2_arry[ i];
                        for(j=0;j<8;j++)
                        {
                                P0 = P0_arry[j];
                                                                                                              delay(200);
                        }                       
                }
        }
}

单片机控制88点阵.png (156.03 KB, 下载次数: 0)

单片机控制88点阵.png

屏幕截图(33).png (168.83 KB, 下载次数: 0)

屏幕截图(33).png
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

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

本版积分规则

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

Powered by 单片机教程网

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