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开发板

  • 相关阅读:
    Python-读取文件内容
    torch_03_二分类
    torch_02_多项式回归
    pytorch_01_基础_一维线性回归
    LC-KSVD 代码解读
    标签一致项(LC-KSVD)-全文解读
    PCA:主成分分析
    牛客刷题-大佬链接
    调试MATLAB代码
    scroll offset & client总结
  • 原文地址:https://www.cnblogs.com/robotes/p/7471042.html
Copyright © 2011-2022 走看看