#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
void init();//hanshushengming
void delay(uint );//hanshushengming
void display_fen(uint aa,uint bb,uint cc);//hanshushengming
void display_miao(uint cc,uint dd);//hanshushengming
void keyscan();//hanshushengming
void display();//hanshushengming
sbit duan=P2^6;
sbit wei=P2^7;
sbit key1=P3^4;
uint t0,t1,num1,num2;
uchar code table[]={
0x3f,0x06,0x5b,0x4f,
0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,
0x39,0x5e,0x79,0x71};
void main()
{
init();
while(1)
{
display();
display_fen(num1/100,num1/10%10,num1%10);
display_miao(num2/10,num2%10);
if(key1==0)
{
delay(10);
基于51单片机的秒表设计
最新推荐文章于 2024-03-06 13:20:04 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)