Four-digit digital tube dynamic display 2020 (51 microcontroller)

Publisher:博雅之士Latest update time:2022-12-20 Source: zhihu Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Circuit schematic

Parts list

Program (C language)

 #include

unsigned char smg[]={0x5b,0x3f,0x5b,0x3f};//2020 glyph code (common anode)

void delay(unsigned int time);

void main()

{

   unsigned char i,W;

   while(1)

  {

    W=0x01;

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

{

     P1=W;

W<<=1;

      P0=smg[i];

     delay(10);

  }

}

}

void delay(unsigned int time)

{

   unsigned int j=0;

   for(;time> 0;time--)

   for(j=0;j<125;j++);

}


Reference address:Four-digit digital tube dynamic display 2020 (51 microcontroller)

Previous article:Simulation of automobile left and right turn signals based on single-chip microcomputer
Next article:51 single-chip microcomputer, four-digit digital tube, 4 LED lights and 4 buttons to achieve multiple functions

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号