zoukankan      html  css  js  c++  java
  • 新型流水灯原码

    #include<reg52.h>

    //声明

    sbit ADDR0 = P1^0;

    sbit ADDR1 = P1^1;

    sbit ADDR2 = P1^2;

    sbit ADDR3 = P1^3;

    sbit ENLED = P1^4;

    void main(){

             //声明相关变量(“unsigned”—无符号)

            unsigned int i=0,j=0;

             unsigned char cot=0;

             ADDR0=0;

             ADDR1=1;

            ADDR2=1;

            ADDR3=1;

            ENLED=0;

                       while(1){           

                                 P0 =~(0x01<<cot);//”P0”即P0^0;P0^1;P0^2;....的总和

                                //for循环延时一段时间熄灭

                                for(i=0;i<30000;i++);

                                         cot++;

                                         //if判断位移的大小,大于8位就置零(回归首地址)

                                         if(cot >= 8){

                                                 cot=0;

                                         }

                       }

    }

    //51开发板为宏晶科技的“KST-51开发板

  • 相关阅读:
    在CentOS7上搭建MySQL主从复制与读写分离
    数据库 引擎
    数据库 事务
    数据库 索引
    MYSQL
    基于mysqld_multi实现MySQL 5.7.24多实例多进程配置
    09 引导过程与故障修复
    chapter 8.3
    作业 8.1
    Chapter 04 作业
  • 原文地址:https://www.cnblogs.com/robotes/p/7471042.html
Copyright © 2011-2022 走看看