倒数100

发布时间: 2024-08-02
来源: 电子工程世界

#include

#define uint unsigned int

#define uchar unsigned char


uchar duan[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};

sbit w1=P2^0;

sbit w2=P2^1;

uint num=0;

void delay(uint n)

{

   while(n--);

   

   }


main()

{

   while(1)

   {

        w1=0;

    w2=0;

    P3=duan[num%10];

    P2=duan[num/10];

       delay(50000);

       num++;

       if(num==99)

      { 

         num=0;

       }

    }    

 }

4106cd5fee2ca467bfbf0075670ca520_1260466-20171118155239093-291971313.png


文章来源于: 电子工程世界 原文链接

本站所有转载文章系出于传递更多信息之目的,且明确注明来源,不希望被转载的媒体或个人可与我们联系,我们将立即进行删除处理。