没有合适的资源?快使用搜索试试~ 我知道了~
多功能时钟程序 优化的多功能时钟设计程序
需积分: 10 5 下载量 26 浏览量
2010-05-24
14:23:57
上传
评论
收藏 9KB TXT 举报
温馨提示
试读
16页
优化的多功能时钟设计程序 #include "reg52.h" #include "intrins.h" #include "absacc.h" #include "viic_c51.h" #include "zlg7290.h" #define uchar unsigned char #define uint unsigned int uint flag=0, flag1=0,flag2=0,flag3=0,flag4;//"半点"蜂鸣器鸣响//"整点"蜂鸣器鸣响 uchar set_bool=0; uchar set_b=0; uchar set_q=0; uchar i_LED[4]={0x60,0x61,0x62,0x63}; //单个显示数字时的LED位数 uchar shuzi[10]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09}; //0~9的
资源推荐
资源详情
资源评论
#include "reg52.h"
#include "intrins.h"
#include "absacc.h"
#include "viic_c51.h"
#include "zlg7290.h"
#define uchar unsigned char
#define uint unsigned int
uint flag=0, flag1=0,flag2=0,flag3=0,flag4;//"半点"蜂鸣器鸣响//"整点"蜂鸣器鸣响
uchar set_bool=0;
uchar set_b=0;
uchar set_q=0;
uchar i_LED[4]={0x60,0x61,0x62,0x63}; //单个显示数字时的LED位数
uchar shuzi[10]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09}; //0~9的数字编码
char set=0;
sbit fengming=P1^0;
sbit KEY1=P3^2;
sbit KEY2=P3^3;
sbit KEY3=P3^4;
sbit KEY4=P3^5;
sbit KEY5=P2^0;
sbit KEY6=P2^1;
sbit LED_S0=P1^1;
sbit LED_S1=P1^2;
sbit LED_S2=P1^3;
sbit LED_S3=P1^4;
char hour=12,minite=0,second=0;
char nhour=6,nminite=30,nsecond=0;
char dhour=99,dminite=59,dsecond=59;
char min=0,se=0,mse=0;
uchar i_time=0;
#include "intrins.h"
#include "absacc.h"
#include "viic_c51.h"
#include "zlg7290.h"
#define uchar unsigned char
#define uint unsigned int
uint flag=0, flag1=0,flag2=0,flag3=0,flag4;//"半点"蜂鸣器鸣响//"整点"蜂鸣器鸣响
uchar set_bool=0;
uchar set_b=0;
uchar set_q=0;
uchar i_LED[4]={0x60,0x61,0x62,0x63}; //单个显示数字时的LED位数
uchar shuzi[10]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09}; //0~9的数字编码
char set=0;
sbit fengming=P1^0;
sbit KEY1=P3^2;
sbit KEY2=P3^3;
sbit KEY3=P3^4;
sbit KEY4=P3^5;
sbit KEY5=P2^0;
sbit KEY6=P2^1;
sbit LED_S0=P1^1;
sbit LED_S1=P1^2;
sbit LED_S2=P1^3;
sbit LED_S3=P1^4;
char hour=12,minite=0,second=0;
char nhour=6,nminite=30,nsecond=0;
char dhour=99,dminite=59,dsecond=59;
char min=0,se=0,mse=0;
uchar i_time=0;
uchar n=0;
uchar disp_buf[6]={0,0,0,0,0,0,};
uchar zhengshu[6],xiaoshu;
/*********************延时******************************/
uchar DelayNS(uchar no)
{
uchar i,j; //延时参数
for(; no>0; no--)
{
for(i=0; i<100; i++)
for(j=0; j<100; j++);
}
return 0;
}
uchar delay(uchar j)
{
uchar k,l;
for(l=0;l<=j;l++)
for(k=0;k<=250;k++);
return 0;
}
//-------------------------------------------------延时函数2
void CPU_DELAYTIME(unsigned int count){
unsigned int iu_LOOP;
for(iu_LOOP=0;iu_LOOP<=count;iu_LOOP++){; }
}
//////////////////////半点鸣响////////////////////////////
uchar disp_buf[6]={0,0,0,0,0,0,};
uchar zhengshu[6],xiaoshu;
/*********************延时******************************/
uchar DelayNS(uchar no)
{
uchar i,j; //延时参数
for(; no>0; no--)
{
for(i=0; i<100; i++)
for(j=0; j<100; j++);
}
return 0;
}
uchar delay(uchar j)
{
uchar k,l;
for(l=0;l<=j;l++)
for(k=0;k<=250;k++);
return 0;
}
//-------------------------------------------------延时函数2
void CPU_DELAYTIME(unsigned int count){
unsigned int iu_LOOP;
for(iu_LOOP=0;iu_LOOP<=count;iu_LOOP++){; }
}
//////////////////////半点鸣响////////////////////////////
剩余15页未读,继续阅读
资源评论
zhi19860218
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功