静态数码管

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

/* Main.c file generated by New Project wizard

 *

 * Created:   周日 十月 22 2017

 * Processor: 80C51

 * Compiler:  Keil for 8051

 */


#include

#define uint unsigned int 

#define uchar unsigned char

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

void delay(uint a)

{

   while(a--);

   }


void main()

 { 

   uint i; 

   while(1)

   {

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

      {

    P2=shuzu[i];

    delay(500000);

     

     

      }

  }

 }


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

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