C-51 single chip dynamic display 01234567

Publisher:纯真年代Latest update time:2022-06-07 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

In the previous chapter, we used static display 1234.5, which was simpler without loop statements. This time, we use dynamic display 01234567

Directly give the reference program: use Keil uVision5 for programming and Proteus 8 Professional for simulation.


#include

#include

#define uchar unsigned char

#define uint unsigned int

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


void delay(fly x)

{

flying i;

while(x--)

{

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

}

}


void main()

{

fly i,j,w=0x80;

while(1)

{

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

{

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

  {

  P2=0x00;

  w=_cror_(w,1) ;

  }

   P0=DSY_CODE[i]; //Send segment code

   P2=w ; //Send bit code

   delay(1);

   }

}

}

insert image description here

Reference address:C-51 single chip dynamic display 01234567

Previous article:AT89C51 MCU external interrupt
Next article:C-51 single chip computer dynamic digital tube display 1234.5

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号