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

正文內(nèi)容

畢業(yè)設計-基于51單片機的室內(nèi)led彩色背景燈的智能化控制設計-資料下載頁

2024-12-02 17:32本頁面

【導讀】發(fā)光二極管作為一種新型光源,具有體積小,效率高,壽命長,環(huán)保,節(jié)能等特點,從一問世起,就引起了世界的廣泛關(guān)注。域,并很快在各領域占有一席之地。常生活中很受歡迎。所以本文主要研究用大功率彩色LED作為室內(nèi)的背景燈,并通過傳感器和STC89C52單片機的控制,達到智能化的效果。代家居智能化的追求。

  

【正文】 time[2])。 time[3]=int_to_bcd(time[3])。 time[4]= int_to_bcd(time[4])。 time[5]= int_to_bcd(time[5])。 time[6]=int_to_bcd(time[6])。 write_time(time)。 //把 time 數(shù)組的時鐘數(shù)據(jù)寫進1302 } void write_(uchar ) //lcd 寫命令 { rs=0。 P0=。 delay(5)。 en=1。 delay(5)。 en=0。 } void write_data(uchar date) //lcd 寫數(shù)據(jù) { rs=1。 P0=date。 delay(5)。 en=1。 39 delay(5)。 en=0。 } void init() //初始化 lcd { TMOD=0x01。 TH0=(6553650000)/256。 TL0=(6553650000)%256。 EA=1。 ET0=1。 TR0=1。 en=0。 w=0。 write_(0x38)。 // 設置 16*2 顯示, 5*7 點陣, 8位數(shù)據(jù)接口 write_(0x0c)。 // 開顯示,不顯示光標,光標不閃爍 write_(0x06)。 // 地址指針、光標自動加 1 write_(0x01)。 // 清屏 write_(0x80)。 // 地址指針初始位置 for(num=0。num15。num++) { write_data(table[num])。 delay(1)。 } write_(0x80+0x40)。 for(num=0。num12。num++) { write_data(table1[num])。 delay(1)。 40 } } void write_sfm(uchar add,uchar date) //寫時、分、秒進 lcd { uchar shi,ge。 shi=date/10。 ge=date%10。 write_(0x80+0x40+add)。 write_data(0x30+shi)。 write_data(0x30+ge)。 } void write_sfm1(uchar add,uchar date) //寫年、月 、日進 lcd { uchar shi,ge。 shi=date/10。 ge=date%10。 write_(0x80+add)。 write_data(0x30+shi)。 write_data(0x30+ge)。 } void doime() { uchar i。 SetProtect1302(0)。 //寫保護開 read_time()。 //從 1302 讀時間 41 miao=bcd_to_int(time[0])。 //bcd 轉(zhuǎn)換成 16 進制,并在 lcd上顯示 write_sfm(10,miao)。 fen=bcd_to_int(time[1])。 write_sfm(7,fen)。 shi=bcd_to_int(time[2])。 write_sfm(4,shi)。 day=bcd_to_int(time[3])。 write_sfm1(9,day)。 mon=bcd_to_int(time[4])。 write_sfm1(6,mon)。 week=bcd_to_int(time[5])。 { write_(0x80+12)。 for(i=0。i3。i++) { write_data(weektable[week][i])。 delay(1)。 } } yea=bcd_to_int(time[6])。 write_sfm1(3,yea)。 SetProtect1302(1)。 42 } void keyscan() //設置時間子程序 { if(s1==0) //判斷是否設置時間按鍵按下 { delay(5)。 //延時消抖 if(s1==0) { s1num++。 //s1 功能鍵按下次數(shù)自加 1,值為 1 while(!s1)。 //松手檢測 if(s1num==1) //依據(jù) s1 功能鍵按下的次數(shù)判斷 lcd 的地址指針指向時分秒日月星期年 { write_(0x80+0x40+11)。 write_(0x0f)。 } if(s1num==2) { while(!s1)。 write_(0x80+0x40+8)。 } if(s1num==3) { while(!s1)。 write_(0x80+0x40+5)。 43 } if(s1num==4) { while(!s1)。 write_(0x80+12)。 } if(s1num==5) { while(!s1)。 write_(0x80+9)。 } if(s1num==6) { while(!s1)。 write_(0x80+6)。 } if(s1num==7) { while(!s1)。 write_(0x80+3)。 } if(s1num==8) //退出時間設置 { while(!s1)。 s1num=0。 while(!s1)。 44 write_(0x0c)。 write_time(time)。 //把調(diào)好的時 間寫入 1302 } } } if(s1num!=0) //調(diào)整時間 { //在 s1 鍵按下后判斷調(diào)時間功能鍵是否被按下 if(s2==0) { delay(5)。 if(s2==0) { while(!s2)。 if(s1num==1) //依據(jù) s1 功能鍵被按下的次數(shù)分別調(diào)整時分秒日月星期年 { miao++。 if(miao==60) miao=0。 write_sfm(10,miao)。 write_(0x80+0x40+10)。 time[0]=int_to_bcd(miao)。 //調(diào)整好的時間轉(zhuǎn)換為bcd 碼,并存放在 time[]數(shù)組中 } if(s1num==2) { 45 fen++。 if(fen==60) fen=0。 write_sfm(7,fen)。 write_(0x80+0x40+7)。 time[1]=int_to_bcd(fen)。 } if(s1num==3) { shi++。 if(shi==24) shi=0。 write_sfm(4,shi)。 write_(0x80+0x40+4)。 time[2]=int_to_bcd(shi)。 } if(s1num==4) { uchar i。 week++。 if(week==7) week=0。 write_(0x80+12)。 for(i=0。i3。i++) { write_data(weektable[week][i])。 } write_(0x80+12)。 time[5]=int_to_bcd(week)。 46 } if(s1num==5) { day++。 if(day==32) day=0。 write_sfm1(9,day)。 write_(0x80+9)。 time[3]=int_to_bcd(day)。 } if(s1num==6) { mon++。 if(mon==13) mon=0。 write_sfm1(6,mon)。 write_(0x80+6)。 time[4]=int_to_bcd(mon)。 } if(s1num==7) { yea++。 write_sfm1(3,yea)。 write_(0x80+3)。 time[6]=int_to_bcd(yea)。 } 47 } } } } void LED() //LED 被點亮的方式 { static buffer1 = 0x3f。 static buffer2 = 0xff。 if(shi=18amp。amp。shi=24) { while(k==0) //光敏電阻處于暗阻狀態(tài) { if(flag1==1) { flag1=0。 if(buffer1 == 0x03) { buffer1 = 0x3f。 buffer2 = 0xff。 } P2 = (buffer1 amp。 buffer2) |0xc0。 buffer1 =1。 buffer2 =1。 //P2=~P2。 48 } doime()。 } P2=0xff。 doime()。 } } void timer0() interrupt 1 { TH0=(6553650000)/256。 TL0=(6553650000)%256。 t0++。 if(t0=10) { t0=0。 flag1=1。 } } void main() //主程 序 { init()。 //初始化 lcd S
點擊復制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1