数字时钟C语言源程序
#include//头文件
#define uchar unsigned char
#define uint unsigned int //宏定义
uchar count;
uint hour,minute,second;
uint hour1=0,minute1=0;
sbit dula=P2^6;
sbit wela=P2^7;
sbit key1=P3^0;
sbit key2=P3^1;
sbit key3=P3^2;
sbit key4=P3^3;
sbit key5=P3^4;
sbit key6=P3^5;
sbit key7=P3^6;
sbit BEEP=P1^2;
uchar code duan[]={
0x3f,0x06,0x5b,0x4f,
0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x40}; //0-9,横杆
uchar code wei[]={
0xfe,0xfd,0xfb,0xf7,
0xef,0xdf,0xbf,0x7f}; //扫描
void delay(uint z)//延时函数
{
uchar x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
void init()//初始化中断
{
TMOD=0x10;/
如果觉得《数字时钟程序c语言 数字时钟C语言源程序》对你有帮助,请点赞、收藏,并留下你的观点哦!