基于單片機(jī)的籃球計(jì)時(shí)計(jì)分器
按下k1比賽開(kāi)始
按下k2比賽暫停
按下k3鍵24s重新計(jì)時(shí)(用于搶斷,或后場(chǎng)籃板等)
k4加1分
k5加2分
k6加3分
元件清單:
AT89c52單片機(jī)
R1—R8
R9—R16
R17—R24
三極管 9015
四位一體共陽(yáng)數(shù)碼管兩個(gè)
其他的電路圖上能看清
制作原理圖如下:
源程序:
#include
#define uint unsigned int
#define uchar unsigned char
uchar code table[]={
0xc0,0xf9,0xa4,0xb0,
0x99,0x92,0x82,0xf8,
0x80,0x90};
uchar code table1[]={
0x40,0x79,0x24,0x30,
0x19,0x12,0x02,0x78,
0x00,0x10};
sbit k1=P3^1;
sbit k2=P3^2;
sbit k3=P3^3;
sbit k4=P3^4;
sbit k5=P3^5;
sbit k6=P3^6;
sbit beep=P3^7;
uchar second,minute;
uint num,num1,num2,num3,num4,num5,sum,sum1,sum2,sum3;
void display();
void keyscan();
void delay(uint z)
{
}
void init()
{
}
void main()
{
}
void timer0() interrupt 1
{
}
void timer1() interrupt 3
{
}
void display()
{
}
void keyscan()
{
}
評(píng)論