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

正文內(nèi)容

畢業(yè)設計-城市道口交通燈控制系統(tǒng)模型的設計-資料下載頁

2024-12-03 19:41本頁面

【導讀】究有效地改善了交通堵塞等現(xiàn)象。利用單片機可編程的特點,設計制作城市道口。交通燈控制系統(tǒng)。系統(tǒng)由硬件和軟件兩個部分組成,設計以單片機AT89C52為。系統(tǒng)工作穩(wěn)定可靠,實用性強。最后介紹了系統(tǒng)的存儲單元分配,軟件流程圖,軟件源程序及注釋等內(nèi)容。1系統(tǒng)的功能和基本原理··································································6

  

【正文】 */ uchar code ym[33]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e, 0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78,0x00,0x10,0x08,0x03,0x46,0x21,0x06,0x0e, 0xff}。 //數(shù)碼管譯碼 。 void led(uchar d,uchar *s) { uchar d1,d2,d3。 d1=d/100。 d2=d%100/10。 d3=d%10。 //*s=0xff。 if(d1==0) { if(d2==0) *(s+2)=0xff。 else *(s+2)=ym[d2]。 //*(s+1)=0xff。 } else { *(s+1)=ym[d1]。*(s+2)=ym[d2]。} *(s+3)=ym[d3]。 } /* The system deployment time, the progress of adjusted disposable procedure, I / 0 input and output coordination, so that procedures can be in the right time frame operation. 28 */ void ttime(void) interrupt 1 using 1 { uchar i。 // if(tt++==4999) //make one second { tt=0。 if(ds1!=255 amp。amp。 ds1!=0) ds1。 if(ds2!=255 amp。amp。 ds2!=0) ds2。 if(!hongw) { jj_t=5。jj_ea=1。} //timely processing else if(jj_t!=0) jj_t。 else jj_ea=0。 } // if((tamp。0x07)==0) //LED display { i=smg_p++ amp。 0x07。 switch(i) { case 0:P0=0。P3=0xfe。P0=~smg[i]。break。 case 1:P0=0。P3=0xfd。P0=~smg[i]。break。 case 2:P0=0。P3=0xfb。P0=~smg[i]。break。 case 3:P0=0。P3=0xf7。P0=~smg[i]。break。 case 4:P0=0。P3=0xef。P0=~smg[i]。break。 case 5:P0=0。P3=0xdf。P0=~smg[i]。break。 default:P3=0xff。 } } // else if((tamp。0x3f)==1) //key operate key_ea=1。 // else if(t==2) 29 { if((ss_tamp。0x07)==0) ss=~ss。 ss_t++。 } // else if(t==3) //LED driver { if(jj_ea) { led(jj_t,smg+2)。 led(jj_t,smg1)。} else { if(ds2!=255) led(ds21,smg+2)。 else led(0,smg+2)。 if(ds1!=255) led(ds11,smg1)。 else led(0,smg1)。 } } t++。 } /* Through edge detection button, regular count judgment is short or long keypad keys, read keys to get rid keys. */ void key_operate() { P3 |=0xc0。 key=P3amp。0xc0。 if(key!=key_) { if(key_t4 amp。amp。 key_t =40) { switch(key_) //short time keys { case 0x80:key_d=0。break。 case 0x40:key_d=1。break。 30 case 0x00:key_d=2。break。 default:key_d=255。 } } else if(key_t40) { switch(key_) //Long time keys { case 0x80:key_d=4。break。 case 0x40:key_d=5。break。 case 0x00:key_d=6。break。 default:key_d=255。 } } key_t=0。 key_=key。 } else key_t++。 } /* After detecting keys, according to the state where the operation to which judgment */ void key_check() { if(key_d==0) //Model display { mod=~mod。 if(mod) { smg[0]=0xff。smg[3]=0xff。} else { smg[0]=0xf7。smg[3]=0xf7。} } else if(key_d==1 amp。amp。 st!=11) //Judge key to pedestrians { if(st!=10) 31 { dz[0]=ds1。dz[1]=ds2。dz[2]=d1。dz[3]=d2。dz[4]=ss1。dz[5]=ss2。dz[6]=st。dz_dj=1。} {ds1=0。ds2=0。st=8。} _nop_()。 } else if(key_d==5) //Judge emergency vehicles { if(st==10) { dz[7]=ds1。dz[8]=ds2。dz[9]=d1。dz[10]=d2。dz[11]=ss1。dz[12]=ss2。dz[13]=st。dz_dj=2。} else if(st!=11) { dz[0]=ds1。dz[1]=ds2。dz[2]=d1。dz[3]=d2。dz[4]=ss1。dz[5]=ss2。dz[6]=st。dz_dj=1。} ds1=0。ds2=0。st=9。 } } /* As procedures and hardware system interface, the system is more multiadjustable and procedures of the transplant system. */ void output() { p07=1。hongw=p07。 //hongwai check if(jj_ea) {P1=0xff。P2=0xff。} else if((ds14 ||ds24) amp。amp。 ss){ P1=d1|ss1。P2=d2|ss2。} else { P1=d1。P2=d2。} } 32 /* After the electricity system initialization need to ensure that effective procedures to correct the conduct of the next operation. */ void initial() { uchar i。 Init_Device()。 for(i=0。i6。i++) smg[i]=0xff。 P3 |=0xc0。 key=P3amp。0xc0。 key_=key。 key_d=255。 ss1=0xff。 ss2=0xff。 } void main(void) { initial()。 //system initial while(1) { if(key_ea) { key_operate()。key_ea=0。} //key down operate if(key_d!=255) { key_check()。key_d=255。} //check value of key output()。 //inteface of system if(ds1==0 || ds2==0) //the status system { switch(st) { case 0: ds11= 30。ds21= 10。d1=0xbb。d2=0x77。ss1=0x82。ss2=0x14。st++ 。break。 case 1: ds11=ds1。ds21= 30。d1=0x39。d2=0x63。ss1=0x44。ss2=0x00。st++ 。break。 33 case 2: ds11= 10。ds21=ds2。d1=0x7d。d2=0x63。ss1=0x28。ss2=0x88。st++ 。break。 case 3: ds11= 30。ds21= 30。d1=0x55。d2=0xeb。ss1=0xbb。ss2=0x36。st++ 。break。 case 4: ds11= 30。ds21= 10。d1=0xee。d2=0xdd。ss1=0x82。ss2=0x14。st++ 。break。 case 5: ds11=ds1。ds21= 30。d1=0x6c。d2=0xc9。ss1=0x11。ss2=0xaa。st++ 。break。 case 6: ds11= 10。ds21=ds2。d1=0x7d。d2=0x63。ss1=0x00。ss2=0xc9。st++ 。break。 case 7: ds11= 30。ds21= 30。d1=0x7d。d2=0xaa。ss1=0xc6。ss2=0xdd。st=0 。break。 case 8: ds1 = 15。ds2 = 15。d1=0xee。d2=0x77。ss1=0xff。ss2=0xff。st=10。break。 case 9: ds1 = 15。ds2 = 15。d1=0xff。d2=0xff。ss1=0xff。ss2=0xff。st=11。break。 case 10: if(dz_dj!=0) dz_dj。dz_ea=1。break。 case 11: if(dz_dj!=0) dz_dj。dz_ea=1。break。 default: st=0。 } if(st8) //if there have transformation { ds12=(ds11127)?255:(2*ds11)。 ds22=(ds21127)?255:(2*ds21)。 ds1=(mod)?ds11:ds12。 ds2=(mod)?ds21:ds22。 34 } else if(dz_ea==1) //pop operate { if(dz_dj==1) { ds1=dz[7]。ds2=dz[8]。d1=dz[9]。d2=dz[10]。ss1=dz[11]。ss2=dz[12]。st=dz[13]。} else if(dz_dj==0) { ds1=dz[0]。ds2=dz[1]。d1=dz[2]。d2=dz[3]。ss1=dz[4]。ss2=dz[5]。st=dz[6]。 dz_ea=0。} } } } }
點擊復制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1