基于单片机数码管秒表控制系统设计
1485下载地址 https://docs.qq.com/doc/DWEpnR2pOWU91b3p4?pub=1&dver=2.1.0
#include <reg51.h> #include <intrins.h> #define uchar unsigned char #define uint unsigned int //共阳极/*0,1,2,3,4,5,6,7,8,9,A,b,C,*/ uchar code SEG7[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0x88,0x83,0xC6}; //显示缓冲 uchar num[4]; //位码定义 sbit q4=P2^3; sbit q3=P2^2; sbit q2=P2^1; sbit q1=P2^0; //按键定义1234 sbit key1=P3^0; sbit key2=P3^1; sbit key3=P3^2; sbit key4=P3^3; //通道 uchar aisle=0; //通道运行标志 uchar bz1=0; uchar bz2=0; uchar bz3=0; //定时变量 uint t1=0; uint t2=0; uint t3=0; //定时器计数变量 uint jishu1=0; uint jishu2=0; uint jishu3=0; //延时函数ms void _delay_ms(uint t)