91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡(jiǎn)介

以AT89C51單片機(jī)為核心,制作一個(gè)LCD顯示的智能電子鐘: (1) 計(jì)時(shí):秒、分、時(shí)、天、周、月、年。 (2) 閏年自動(dòng)判別。 (3) 可調(diào)時(shí)分秒年月日周。 (4) 時(shí)間、月、日交替顯示。 (5) 自定任意時(shí)刻自動(dòng)開(kāi)/關(guān)屏。 (6) 計(jì)時(shí)精度:誤差≤1秒/月(具有微調(diào)設(shè)置)。 (7) 定時(shí)鬧鐘

資源截圖

代碼片段和文件信息

#include?“DS1302.h“
#include?“LM061L.h“
#include?“Keyboard.h“
#include?“absacc.h“//for?debug

sbit?P3_7?=?P3^7;
uchar?init_time[]?=?{0x000x500x110x260x060x030x18};//initial?the?time?(Format:SSMMHHDDmmWWYY)
uchar?code?DIG_CODE[10]={0x300x310x320x330x340x350x360x370x380x39};?//hexadecimal?nums?for?displaying?on?screen
uchar?disp[8]={0x3f0x3f0x3f0x3f0x3f0x3f0x3f0x3f};//an?array?for?saving?time
uchar?disp1[13]={0x3f0x3f0x3f0x3f0x3f0x3f0x3f0x3f0x3f0x3f};//an?array?for?saving?date

uint?count_flag?=?0;?????//count?interupt
uchar?countTimers[7]; //for?saving?the?time?you?wanna?shut?down?the?screen
uchar?tempTimers1[8];
uchar?tempTimers2[13];
uchar?clockTimers[7];
uchar?input_flag?=?0;?//?1?2?3?4?
uchar?screenCls?=?0;//?state?of?sctreen?(0?means?shut?down?the?screen)
uchar?isScreenCls?=?0;//?whether?settingScreen?is?lunched(0?means?No)
uchar?clock?=?0;
uchar?isClock?=?0;
uchar?pos?=?0;//record?the?times?of?these?nums?you?input
uchar?isSave?=?0;
uchar?turn_flag?=?0xff;
uchar?time_mode?=?0;?//?0:?24M?1:?12M

void?timer1_stop();
void?timer1_init();
void?display();//convert?to?hexadecimal?nums?which?LCD?can?display;
void?delay1ms(uint?ms);
void?chooseFunc(uchar?key);//choose?function
void?settingTime();
void?settingScreen();
void?inputDigit(uchar?key);//Convert?key?input?by?user?to?hexadecimal?nums?which?LCD?can?display?and?show?them;
uchar?convertToDecimal(uchar?c);//Hexadecimal?to?decimal
uchar?convertToHexadecimal(uchar?h?uchar?l);//Decimal?to?hexadecimal

//****************************main****************************
void?main(void){
??init_ds1302();?//initiate?DS1302
delay1ms(100);
init_LM061L();?//initiate?LM016L
??timer1_init();?//initiate?timer1
ds1302_writedata(2?0x00);?//?24M
time_mode?=?0;
??while(1){
display();
kbScan();
}
}
//****************************convertToDecimal
uchar?convertToDecimal(uchar?c){
uchar?i;
for(i?=?0;?i? if(c?==?1){
return?i;
}
c?=?c?>>?1;
}
return?0;
}
//****************************convertToHexadecima
uchar?convertToHexadecimal(uchar?h?uchar?l){
return?(h?<}

void?inputFunc(uchar?key){
uchar?oldVal;
isSave?=?1;
if(turn_flag?==?0xff){
oldVal?=?DIG_CODE[key];
if(pos? tempTimers1[pos]?=?oldVal;
}
else{
tempTimers2[pos?-?8]?=?oldVal;
}

//WriteCMD(0x06);
WriteData(oldVal);
if(pos? WriteCMD(0x80?+?pos);
}
else{
WriteCMD(0x80?+?0x40?+?pos?-?8);
}
}else{
if(turn_flag?==?0)
turn_flag?=?1;
else
turn_flag?=?0;
//WriteCMD(0x84?+?pos);
WriteData(turn_flag?|?0x30);
WriteCMD(0x86);
}

delay1ms(200);
}

void?menuFunc(){
uchar?i;
if(input_flag?==?0){
isSave?=?0;
input_flag?=?1;
pos?=?0;
display();
WriteCMD(0x01);
WriteCMD(0x80+15);
WriteData(‘T‘);
WriteCMD(0x80);
for(i=0;i<8;i++){
tempTimers1[i]?=?disp[i];
WriteData(disp[i]);
}
WriteCMD(0

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-07-25?22:43??智能時(shí)鐘4x4-super-power\
?????文件???????24332??2018-06-25?22:11??智能時(shí)鐘4x4-super-power\Backup?Of?SDC2.pdsbak
?????目錄???????????0??2018-07-01?12:37??智能時(shí)鐘4x4-super-power\Keil\
?????文件????????2393??2018-06-26?11:38??智能時(shí)鐘4x4-super-power\Keil\DS1302.h
?????文件????????1237??2018-06-27?15:55??智能時(shí)鐘4x4-super-power\Keil\Keyboard.h
?????目錄???????????0??2018-06-27?22:23??智能時(shí)鐘4x4-super-power\Keil\Listings\
?????文件????????1553??2018-06-24?23:46??智能時(shí)鐘4x4-super-power\Keil\Listings\DELAY1MS.lst
?????文件???????22172??2018-06-27?22:23??智能時(shí)鐘4x4-super-power\Keil\Listings\MAIN.lst
?????文件???????36716??2018-06-27?22:23??智能時(shí)鐘4x4-super-power\Keil\Listings\SDC.m51
?????文件???????14546??2018-06-27?22:23??智能時(shí)鐘4x4-super-power\Keil\Listings\STARTUP.lst
?????文件????????1514??2018-06-26?11:38??智能時(shí)鐘4x4-super-power\Keil\LM061L.h
?????文件???????12126??2018-06-27?22:23??智能時(shí)鐘4x4-super-power\Keil\MAIN.c
?????目錄???????????0??2018-06-27?22:23??智能時(shí)鐘4x4-super-power\Keil\objects\
?????文件?????????409??2018-06-24?23:46??智能時(shí)鐘4x4-super-power\Keil\objects\DELAY1MS.obj
?????文件??????????19??2018-06-25?15:20??智能時(shí)鐘4x4-super-power\Keil\objects\ExtDll.iex
?????文件???????38588??2018-06-27?22:23??智能時(shí)鐘4x4-super-power\Keil\objects\MAIN.obj
?????文件???????32754??2018-06-27?22:23??智能時(shí)鐘4x4-super-power\Keil\objects\SDC
?????文件????????1564??2018-06-27?22:23??智能時(shí)鐘4x4-super-power\Keil\objects\SDC.build_log.htm
?????文件????????7117??2018-06-27?22:23??智能時(shí)鐘4x4-super-power\Keil\objects\SDC.hex
?????文件?????????113??2018-06-27?22:23??智能時(shí)鐘4x4-super-power\Keil\objects\SDC.lnp
?????文件?????????819??2018-06-27?22:23??智能時(shí)鐘4x4-super-power\Keil\objects\STARTUP.obj
?????文件??????167674??2018-07-01?12:37??智能時(shí)鐘4x4-super-power\Keil\SDC.uvgui.99752
?????文件??????168807??2018-06-26?11:55??智能時(shí)鐘4x4-super-power\Keil\SDC.uvgui.Administrator
?????文件????????6702??2018-06-26?11:41??智能時(shí)鐘4x4-super-power\Keil\SDC.uvopt
?????文件???????14373??2018-06-26?11:54??智能時(shí)鐘4x4-super-power\Keil\SDC.uvproj
?????文件????????6376??2016-04-01?17:01??智能時(shí)鐘4x4-super-power\Keil\STARTUP.A51
?????文件???????21777??2018-06-28?13:24??智能時(shí)鐘4x4-super-power\Last?Loaded?SDC.pdsbak
?????文件???????25007??2018-06-25?00:08??智能時(shí)鐘4x4-super-power\Last?Loaded?SDC2.pdsbak
?????文件???????21788??2018-06-29?18:28??智能時(shí)鐘4x4-super-power\SDC.pdsprj
?????文件????????2726??2018-06-30?00:45??智能時(shí)鐘4x4-super-power\SDC.pdsprj.KIRAYOSHIKAGE.99752.workspace

評(píng)論

共有 條評(píng)論

相關(guān)資源