zoukankan      html  css  js  c++  java
  • 计数器

     #include <reg52.h>
     #define uint unsigned int 
     #define uchar unsigned char 
     uchar duan[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x83,0xc6,0xa1,0x86,0x8e,0x71,0x0e,0x0c,0x0b,0x07};
     //            0      1   2   3    4    5     6   7    8    9    A   B     C    D    E    F    1     2    3    4
     void delay(uint a)
     {
        while(a--);
     }
     
     main()
     {
     
        
        while(1)
        {
           
           P2=duan[0];
           delay(500000);
           P3=duan[18];
           P2=duan[1];
           delay(500000);
           P3=duan[18];
           P2=duan[2];
           delay(500000);
           P3=duan[18];
           P2=duan[3];
           delay(500000);
           P3=duan[18];
           P2=duan[4];
           delay(500000);
           P3=duan[18];
           P2=duan[5];
           delay(500000);
           P3=duan[18];
           P2=duan[6];
           delay(500000);
           P3=duan[18];
           P2=duan[7];
           delay(500000);
           P3=duan[18];
           P2=duan[8];
           delay(500000);
           P3=duan[18];
           P2=duan[9];
           delay(500000);
           P3=duan[18];
           P2=duan[10];
           delay(500000);
           P3=duan[18];
           P2=duan[11];
           delay(500000);
           P3=duan[18];
            P2=duan[0];
           delay(500000);
           P3=duan[18];
           P2=duan[1];
           delay(500000);
           P3=duan[19];
           P2=duan[2];
           delay(500000);
           P3=duan[19];
           P2=duan[3];
           delay(500000);
           P3=duan[19];
           P2=duan[4];
           delay(500000);
           P3=duan[19];
           P2=duan[5];
           delay(500000);
           P3=duan[19];
           P2=duan[6];
           delay(500000);
           P3=duan[19];
           P2=duan[7];
           delay(500000);
           P3=duan[19];
           P2=duan[8];
           delay(500000);
           P3=duan[19];
           P2=duan[9];
           delay(500000);
           P3=duan[19];
           P2=duan[10];
           delay(500000);
           P3=duan[19];
           P2=duan[11];
           delay(500000);
           P3=duan[19];
           
           
         }
        
      }
      /*smg(uint z,uint x);
        smg(0,17);
        delay(100000);
        smg(1,17);
        delay(100000);
         smg(2,17);
        delay(100000);*/
        
    归去来兮
  • 相关阅读:
    java注解
    Mac窗口管理管理软件SizeUp
    mac下8080端口到80端口的转发
    mac svn的替代品CornerStone
    模板模式讲解二
    数组和集合List的相互转化
    fastjson使用示例
    模板模式讲解一
    mybatis-generator-core自动生成do、mapping、dao 代码
    maven依赖传递关系
  • 原文地址:https://www.cnblogs.com/zoute/p/7840695.html
Copyright © 2011-2022 走看看