【正文】
break。/*跳出 */ } } } } /*中斷 1 緊急情況處理程序 */ void int1(void) interrupt 2 { P1=0xF6,P0=a[0]。/*東西南北方向均紅燈亮, P0 口輸出 0*/ 鄭州航空工業(yè)管理學院畢業(yè)設(shè)計(論文) 32 EA=0。/*CPU 禁止響應(yīng)一切中斷 */ TR0=!TR0。/*計數(shù)器停止工作 */ for(。)/*無條件循環(huán) */ { /*數(shù)碼管掃描程序, */ wela=1。 P0=0x01。 //南北方向數(shù)碼管顯示可通行時間的十位 wela=0。 delay(1000)。 /*延時 */ wela=1。 P0=0x02。 /*南北方向數(shù)碼管顯示可通行時間的個位 */ wela=0。 delay(1000)。 /*延時 */ wela=1。 P0=0x10。 //東西方向數(shù)碼管顯示可通行時間的十位 wela=0。 delay(1000)。 /*延時 */ wela=1。 P0=0x20。 //東西方向數(shù)碼管顯示可通行時間的個位 wela=0。 delay(1000)。 /*延時 */ /*返回 */ if(K7==0) /*P3^7=0*/ { delay(10)。/*延時,把抖動的時間拋掉 */ if(K7==0) { while(!K7)//當松開 K7 開關(guān)時,跳出空循環(huán),執(zhí)行后面的序 { light()。 led()。 } EA=1。/*CPU 開放總中斷 */ TR0=!TR0。/*啟動計數(shù)器 */ break。/*跳出 */ } } } } 鄭州航空工業(yè)管理學院畢業(yè)設(shè)計(論文) 33 /*東西南北交通燈選亮鍵盤程序 */ void key() { /*南北有車而東西無車 */ if(K0==0) /*K0=0*/ { delay(10)。/*延時,把抖動的時間拋掉 */ if(K0==0) { while(!K0)//當松開 K0 開關(guān)時,跳出循環(huán),執(zhí)行后面的程序 { light()。/*調(diào)用交通燈函數(shù) */ led()。 /*調(diào)用數(shù)碼管函數(shù) */ } count=0。/*清零 */ k=0。/*南北方向通車,東西方向不通車 */ SN=SN_G,WE=SN_G+Y+10。/*南北方向顯示時間為南北方向綠燈通行時間,東西方向顯示時間為南北方向綠燈通行時間加黃燈閃亮時間 */ light()。/*調(diào)用交通燈函數(shù) */ led()。 /*調(diào)用數(shù)碼管函數(shù) */ } } /*南北無車而東西有車 */ if(K1==0) /*K1=0*/ { delay(10)。/*延時,把抖動的時間拋掉 */ if(K1==0) { while(!K1)//當松開 K1 開關(guān)時,跳出循環(huán),執(zhí)行后的程序 { light()。/*調(diào)用交通燈函數(shù) */ led()。 /*調(diào)用數(shù)碼管函數(shù) */ } count=0。/*清零 */ k=3。/*南北方向不通車,東西方向通車 */ SN=WE_G+Y+10,WE=WE_G。/*南北方向顯示時間為東西方向綠燈通行時間 加黃燈閃亮時間,東西方向顯示時間為東西方向綠燈通行時間 */ light()。/*調(diào)用交通燈函數(shù) */ led()。 /*調(diào)用數(shù)碼管函數(shù) */ } } } /*中斷,定時函數(shù) */ void time1(void) interrupt 1 鄭州航空工業(yè)管理學院畢業(yè)設(shè)計(論文) 34 { TH0=0x3c。 TL0=0xb0。/*計 50000 個數(shù),用時 50ms*/ count++。 /*自增運算 */ if(count=20)/*當 count 大于或等于 20 時,歷時 1s,執(zhí)行程序 */ { SN。/*自 減運算 */ WE。/*自減運算 */ count=0。/*清零 */ if(SN==0||WE==0)/*當 SN=0 或者 WE=0 時,執(zhí)行程序 */ { k++。/*自增運算 */ count1()。 count2()。 if(k5)/*當 k3 時,執(zhí)行程序 */ k=0。/*清零 */ switch(k)/*switch 語句 */ { case 0:SN=SN1,WE=WE1,TH1=0,TL1=0。break。/*南北方向顯示時間為南北方向綠燈通行時間,東西方向顯示時間為南北方向綠燈通行時間加黃燈閃亮時間 */ case 1:SN=Y,WE=Y+10。break。 /*東西南北方向顯示時間均為黃燈閃亮時間 */ case 2:SN=10,WE=10。break。/*南北左行 */ case 3:SN=SN2,WE=WE2,LWE=0,m=0。break。/*南北方向顯示時間為東西方向綠燈通行時間加黃燈閃亮時間,東西方 向顯示時間為東西方向綠燈通行時間 */ case 4:SN=Y+10,WE=Y。break。 /*東西南北方向顯示時間均為黃燈閃亮時間*/ case 5:SN=10,WE=10。break。/*東西左行 */ } } } } /*延時 t 毫秒時間 */ void delay(uchar t) { uchar i。 for(t。t0。t) for(i=110。i0。i)。 } /*交通燈閃爍函數(shù) */ void light() { 鄭州航空工業(yè)管理學院畢業(yè)設(shè)計(論文) 35 P1=c[k]。/*交通燈對應(yīng)著 k 的值變化 */ if(P1==c[1]amp。amp。count==0)/*當南北方向亮黃燈且 count=0 時,執(zhí)行程序 */ { P1=0xB7。/*南北方向黃燈熄滅,東西方向亮紅燈 */ } else if(P1==c[4]amp。amp。count==0)/*當東西方向亮黃燈且 count=0 時,執(zhí)行程序 */ { P1=0x7E。/*南北方向亮紅燈,東西方向黃燈熄滅 */ } } /*數(shù)碼管顯示函數(shù) */ void led() { dula=1。 P0=a[SN/10]。 dula=0。 wela=1。 P0=0x01。 /*顯示南北方向十位 */ wela=0。 delay(1000)。 /*延時 */ dula=1。 P0=a[SN%10]。 dula=0。 wela=1。 P0=0x02。 /*顯示南北方向個位 */ wela=0。 delay(1000)。 /*延 時 */ dula=1。 P0=a[WE/10]。 dula=0。 wela=1。 P0=0x10。 /*顯示東西方向十位 */ wela=0。 delay(1000)。 /*延時 */ dula=1。 P0=a[WE%10]。 dula=0。 wela=1。 P0=0x20。 /*顯示東西方向個位 */ wela=0。 鄭州航空工業(yè)管理學院畢業(yè)設(shè)計(論文) 36 delay(1000)。 /*延時 */ } void main(void) { init()。/*調(diào)用程序初始化函數(shù) */ for(。)/*無條件循環(huán) */ { flow1()。 flow2()。 key()。/*調(diào)用鍵盤程序 */ light()。/*調(diào)用交通燈函數(shù) */ led()。 /*調(diào)用數(shù)碼管函數(shù) */ } } g an employment tribunal claim Employment tribunals sort out disagreements between employers and employees. You may need to make a claim to an employment tribunal if: ? you don39。t agree with the disciplinary action your employer has taken against you ? your employer dismisses you and you think that you have been dismissed unfairly. For more information about dismissal and unfair dismissal, see Dismissal. You can make a claim to an employment tribunal, even if you haven39。t appealed against the disciplinary action your employer has taken against you. However, if you win your case, the tribunal may reduce any pensation awarded to you as a result of your failure to appeal. Remember that in most cases you must make an application to an employment tribunal within three months of the date when the event you are plaining about happened. If your application is received after this time limit, the tribunal will not usually accept it. If you are worried about how the time limits apply to you, take advice from one of the anisations listed under Further help. Employment tribunals are less formal than some other courts, but it is still a legal process and you will need to give evidence under an oath or affirmation. Most people find making a claim to an employment tribunal challenging. If you are thinking about making a claim to an employment tribunal, you should get help straight away from one of the anisations listed under Further help. If you are being represented by a solicitor at the tribunal, they may ask you to sign an agreement where you pay their fee out of your pensation if you win the case. This is known as a damagesbased agreement. In England and Wales, your solicitor can39。t charge you more than