10秒秒表
首次按键计时开始,再次按键暂停,第三次按键清零。
电路如图:
程序如下:
#include<reg51.h>
#define uchar unsigned char
#define uint unsigned int
sbit K1=P3^7;
uchar i,Second_Counts,Key_Flag_Idx;
bit Key_State;
uchar DSY_CODE[]={
0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};