Countdown 100

Publisher:美丽花朵Latest update time:2024-08-02 Source: cnblogs Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

#include

#define uint unsigned int

#define uchar unsigned char


fly 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


Reference address:Countdown 100

Previous article:Rectangular button
Next article:Download CC2530 Experimental Platform

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号