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

正文內(nèi)容

模擬路燈控制系統(tǒng)的設(shè)計-資料下載頁

2025-07-07 14:48本頁面
  

【正文】 WP 為1,禁止寫操作 }}/***************檢查忙否*****************/void Checkstates(){ unsigned char dat。 LCD_RS=0。 LCD_RW=1。 DO { LCD_E=1。//下降沿 _nop_()。//保持一定間隔 _nop_()。 dat=LCD_Data。 _nop_()。 _nop_()。 LCD_E=0。 }while((datamp。0x80)==1)。}/**********LCD寫數(shù)據(jù)*******************************/void WriteDataLCD(unsigned char dat){Checkstates()。LCD_RS=1。LCD_RW=0。LCD_Data=dat。LCD_E=1。delay(2)。LCD_E=0。}/**********LCD寫地址*******************************/void WriteCommandLCD(unsigned char udat){Checkstates()。LCD_RS=0。LCD_RW=0。LCD_Data=udat。LCD_E=1。delay(2)。LCD_E=0。}/*************LCD初始化******************************/void LCDInit(void){WriteCommandLCD(0x38)。delay(2)。WriteCommandLCD(0x38)。delay(2)。WriteCommandLCD(0x01)。delay(2)。 WriteCommandLCD(0x06)。delay(2)。 WriteCommandLCD(0x0C)。delay(2)。}/*************LCD清屏指令**********************/void LCDClear(void){WriteCommandLCD(0x01)。delay(2)。}/**********發(fā)送內(nèi)容*********************************/void LCDSendWord(unsigned char *p){while(*p0) {WriteDataLCD(*p)。p++。 }}/*********發(fā)送地址*********************************/void LCDTestWord(bit i,unsigned char word){ if(i==0) { WriteCommandLCD(word)。 } else { WriteDataLCD(word)。 } }/***************LCD顯示年************/void DisplayYear(void){year=ReadDs1302(0x8d)。LCDTestWord(0,0x80)。LCDSendWord(20)。LCDTestWord(1,(year/16)+0x30)。LCDTestWord(1,year%16+0x30)。LCDTestWord(1,39。/39。)。}/***************LCD顯示月*************************/void DisplayMonth(void){month=ReadDs1302(0x89)。LCDTestWord(1,(month/16)+0x30)。LCDTestWord(1,month%16+0x30)。LCDTestWord(1,39。/39。)。}/****************LCD顯示日**************************/void DisplayDay(void){day=ReadDs1302(0x87)。LCDTestWord(1,(day/16)+0x30)。 LCDTestWord(1,day%16+0x30)。}/**********LCD顯示時*********************************/void DisplayHour(void){hour=ReadDs1302(0x85)。LCDTestWord(0,0xc0)。LCDTestWord(1,(hour/16)+0x30)。LCDTestWord(1,hour%16+0x30)。LCDTestWord(1,39。:39。)。}/**********LCD顯示分**********************************/void DisplayMin(void){min=ReadDs1302(0x83)。LCDTestWord(1,(min/16)+0x30)。LCDTestWord(1,min%16+0x30)。LCDTestWord(1,39。:39。)。}/**********LCD顯示秒**********************************/void DisplaySec(void){sec=ReadDs1302(0x81)。LCDTestWord(1,(sec/16)+0x30)。LCDTestWord(1,sec%16+0x30)。}/************************************************************/void UpDate1(void){DisplayHour()。DisplayMin()。 DisplaySec()。}/************************************************************/void UpDate2(void){ DisplayYear()。DisplayMonth()。DisplayDay()。}/*************鍵掃描程序**************/uchar keys(void){ uchar tmp。 if((P1amp。0xff)!=0xff) { delay(10)。 if((P1amp。0xff)!=0xff) { tmp=(P1amp。0xff)。 do{}while((P1amp。0xff)!=0xff)。 tmp=~tmp。 return (tmp)。 } } return (0)。 } void baojing(void){ if(P01==0) { LCDTestWord(0,0x80)。 LCDSendWord(LED1 Broken)。 P07=0。 } else { LCDTestWord(0,0x80)。 LCDSendWord(LED1 OK )。 } if(P02==0) { LCDTestWord(0,0xc0)。 LCDSendWord(LED2 Broken)。 P07=0。 } else { LCDTestWord(0,0xc0)。 LCDSendWord(LED2 OK )。 } if(P01==1amp。amp。P02==1) P07=1。} void huanjing(void){ while(v!=4) { if(P00==1) { P36=1。 P37=1。 } if(P00==0) { P36=0。 P37=0。 } baojing()。 v=keys()。 }} void jiaotong(void){ while(v!=4) { SC=0。 SB=0。 if(P03==0) { P36=0。 P37=1。 while(1) { if(P04==0) { P36=1。 P37=0。 while(1) { if(P05==0) { P36=1。 P37=1。 SC=1。 SB=1。 while(P05==0)。 } if(SC==1)break。 } } if(SB==1)break。 }} if(P05==0) { P36=1。 P37=0。 while(1) { if(P04==0) { P36=0。 P37=1。 while(1) { if(P03==0) { P36=1。 P37=1。 SC=1。 SB=1。 while(P03==0)。 } if(SC==1)break。 } } if(SB==1)break。 }} v=keys()。} }void Displayrealtime(void){ while(v!=4) { UpDate2()。 UpDate1()。 v=keys()。 }}void Display1(void){ LCDTestWord(0,0x80)。 LCDSendWord(LED1 ON )。 LCDTestWord(1,(Led1onH/10)+0x30)。 LCDTestWord(1,(Led1onH%10)+0x30)。 LCDTestWord(1,39。:39。)。 LCDTestWord(1,(Led1onM/10)+0x30)。 LCDTestWord(1,(Led1onM%10)+0x30)。 LCDTestWord(0,0xc0)。 LCDSendWord(LED1 OFF )。 LCDTestWord(1,(Led1offH/10)+0x30)。 LCDTestWord(1,(Led1offH%10)+0x30)。 LCDTestWord(1,39。:39。)。 LCDTestWord(1,(Led1offM/10)+0x30)。 LCDTestWord(1,(Led1offM%10)+0x30)。}void Display2(void){ LCDTestWord(0,0x80)。 LCDSendWord(LED2 ON )。 LCDTestWord(1,(Led2onH/10)+0x30)。 LCDTestWord(1,(Led2onH%10)+0x30)。 LCDTestWord(1,39。:39。)。 LCDTestWord(1,(Led2onM/10)+0x30)。 LCDTestWord(1,(Led2onM%10)+0x30)。 LCDTestWord(0,0xc0)。 LCDSendWord(LED2 OFF )。 LCDTestWord(1,(Led2offH/10)+0x30)。 LCDTestWord(1,(Led2offH%10)+0x30)。 LCDTestWord(1,39。:39。)。 LCDTestWord(1,(Led2offM/10)+0x30)。 LCDTestWord(1,(Led2offM%10)+0x30)。}void settime(void){ LCDClear()。 LCDTestWord(0,0x80)。 LCDSendWord(Please Set Time)。 delay(2000)。 LCDClear()。 v=keys()。 while(v!=4) { switch(v) { case 0: UpDate2()。 UpDate1()。
點擊復(fù)制文檔內(nèi)容
試題試卷相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1