freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

單片機(jī)電子時(shí)鐘課設(shè)論文1-文庫(kù)吧

2025-06-03 07:04 本頁(yè)面


【正文】 程圖并對(duì)軟件流程圖進(jìn)行說(shuō)明 該課程設(shè)計(jì)采用C語(yǔ)言編程程序,程序設(shè)計(jì)框圖如下: 0程序源代碼清單include include define KeyPort P3 //按鍵端口define DataPort P0 //數(shù)據(jù)端口sbit LATCH1=P2^2。//段鎖存sbit LATCH2=P2^3。//位鎖存sbit P2_0=P2^0。 //報(bào)警sbit P2_5=P2^5。sbit P2_7=P2^7。unsigned int panduan,baojing。unsigned int bian1。//調(diào)時(shí)unsigned int bian2,bian3,bian4,bian5,bian6。//鬧鐘bit ReadTimeFlag。//定義讀時(shí)間標(biāo)志unsigned int xianshi,shijian。//顯示學(xué)好是用unsigned char code dofly_DuanMa[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}。// 顯示段碼值0~9unsigned char code dofly_WeiMa[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f}。//位碼unsigned char TempData[8]。 //存儲(chǔ)顯示值的全局變量void DelayUs2x(unsigned char t)。//us級(jí)延時(shí)函數(shù)聲明 void DelayMs(unsigned char t)。 //ms級(jí)延時(shí)void Display(unsigned char FirstBit,unsigned char Num)。//數(shù)碼管顯示函數(shù)+報(bào)警函數(shù) unsigned char KeyScan(void)。//鍵盤(pán)掃描void Init_Timer0(void)。//定時(shí)器初始化/* 主函數(shù)*/void main (void){unsigned char num。//鍵盤(pán)掃描Init_Timer0()。 //定時(shí)器初始化Ds1302_Init()。 // DS1302初始化Ds1302_Write_Time()。//向DS1302寫(xiě)入時(shí)鐘數(shù)據(jù)while (1) //主循環(huán) { num=KeyScan()。 switch(num) { case 1:bian1++。if(bian1==4)bian1=0。break。//設(shè)置時(shí)間 case 2:if(bian1==1) //設(shè)置時(shí)間加1 { time_buf1[4]++。if(time_buf1[4]==24)time_buf1[4]=0。 Ds1302_Write_Time()。//小時(shí) }else if(bian1==2) { time_buf1[5]++。if(time_buf1[5]==60)time_buf1[5]=0。 Ds1302_Write_Time()。//分 }else if(bian1==3) { time_buf1[6]++。if(time_buf1[6]==60)time_buf1[5]=0。 Ds1302_Write_Time()。 //秒 }break。 case 3:if(bian1==1) //設(shè)置時(shí)間減1 { time_buf1[4]。if(time_buf1[4]==255)time_buf1[4]=23。 Ds1302_Write_Time()。//小時(shí) }else if(bian1==2) { time_buf1[5]。if(time_buf1[5]==255)time_buf1[5]=59。 Ds1302_Write_Time()。//分 }else if(bian1==3) { time_buf1[6]。if(time_buf1[6]==255)time_buf1[5]=59。 Ds1302_Write_Time()。 //秒 } break。 case 4:bian2++。if(bian2==2)bian2=0。break。//切換顯示、鬧鈴 case 5:bian3++。if(bian3==4)bian3=0。break。//設(shè)置鬧鐘時(shí)間 case 6:if(bian3==1) //加1 { bian4++。if(bian4==24)bian4=0。//小時(shí) }
點(diǎn)擊復(fù)制文檔內(nèi)容
數(shù)學(xué)相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1