【正文】
(i=8。 i0。 i) { DQ = 0。 DQ = datamp。0x01。 //寫入一位數(shù)據(jù) delay_MS(5)。 DQ = 1。 dat=1。 //右移一位數(shù)據(jù) } } void tmpchange(void) // DS18B20 begin change // 發(fā)送溫度轉(zhuǎn)換命令 24 { Init_DS18B20()。 // 初始化 DS18B20 delay_MS(200)。 // 延時 WriteOneChar(0xcc)。 // 跳過序列號命令 WriteOneChar(0x44)。 // 發(fā)送溫度 轉(zhuǎn)換命令 } uint tmp() //get the temperature /* 讀出溫度函數(shù) */ { // float tt。 Init_DS18B20()。 // 初始化 ds18b2 子函數(shù) delay_MS(1)。 WriteOneChar(0xcc)。 // 跳過 ROM 命令 WriteOneChar(0xbe)。 // 發(fā)送讀取數(shù)據(jù)命令 temp_data[0]=ReadOneChar()。 // 連續(xù)讀兩個字節(jié)數(shù)據(jù) temp_data[1]=ReadOneChar()。 temp1=temp_data[1]。 temp1=8。 temp1=temp1|temp_data[0]。 // 兩字節(jié)合成一個整型變量。 return temp1。 // 返回溫度值 } void tem_deal(uint tem) /* 溫度數(shù)據(jù)顯示處理函數(shù) */ { if(tem6348) // 溫度值正負判斷 { tem=65536tem。 flag1=1。 25 } // 負溫度求補碼 ,標(biāo)志位置 1 else flag1=0。 Dis_ram[0]=temamp。0x0f。 // 取小數(shù)部分的值 Dis_play[3]=Dis_ram[0]。 // 存入小數(shù)部分顯示值 Dis_ram[0]=tem4。 // 取中間八位 ,即整數(shù)部分的值 Dis_play[0]=Dis_ram[0]/100。 // 取百位數(shù)據(jù)暫存 Dis_play[2]=Dis_ram[0]%100。 // 取后兩位數(shù)據(jù)暫存 if(Dis_play[2]=XX) Dis_play[4]=1 。 else Dis_play[4]=0 。 if(Dis_play[2]=SX) Dis_play[5]=1 。 else Dis_play[5]=0 。 Dis_play[1]=Dis_play[2]/10。 // 取十位數(shù)據(jù)暫存 Dis_play[2]=Dis_play[2]%10。 // 取個位數(shù)據(jù)暫存 if(!Dis_play[0]) // 最高位為 0 都不顯示 { Dis_play[0]=0x0a。 // 先判斷百位是否為 0 if(!Dis_play[1]) { Dis_play[1]=0x0a。 // 再判斷十位是否為 0 } } if(flag1) { Dis_play[0]=0x0b。 // 為負數(shù)時 ,最高位顯示 } 26 } void shengwen() { LED1=~LED1。 } void jiangwen() { LED2=~LED2。 } void display() /*****顯示溫度子程序 *****/ { char k。 for(k=0。k4。k++) //4 位 LED 掃描控制 { if(table[Dis_play[k]] != 0) { Disdata=table[Dis_play[k]]。 //數(shù)據(jù)顯示 } if (k==2){DIN=0。} //小數(shù)點顯示 discan=scan_con[k+3]。 //位選 delay_MS(90)。 //延時 discan=0x00。 } discan=scan_con[7]。 //位選 Disdata=0xc6。 //顯示 C delay_MS(90)。 discan=0x00。 27 } /*****主函數(shù) *****/ void main(void) { EA=1。 //允許 INT0 中斷 EX0=1。 IT0=1。 //下降沿觸發(fā) do { tmpchange()。 //溫度轉(zhuǎn)換 tem_deal(tmp())。 //顯示溫度值 display()。 if(Dis_play[4]==1) shengwen()。 else LED1=1。 if(Dis_play[5]==1) jiangwen()。 else LED2=1。 } while(1)。 } void EX_INT0() interrupt 0 { int ge,shi,k。 while(!SET) { if(ADD==0) { delay1(120)。 if(ADD==0) 28 { SX++ 。 if(SX40) SX=25。 shi=SX/10。 ge=SX%10。 for(k=10。k0。k) { P0=table[shi]。 discan=scan_con[5]。 delay1(10)。 discan=0x00。 P0=table[ge]。 discan=scan_con[6]。 delay1(10)。 discan=0x00。 discan=scan_con[7]。 //位選 Disdata=0xc6。 //顯示 C delay1(10)。 discan=0x00。 } } } if(DEC==0) { delay1(120)。 if(DEC==0) { XX 。 if(XX15) XX=24。 29 shi=XX/10。 ge=XX%10。 for(k=10。k0。k) { P0=table[shi]。 discan=scan_con[4]。 delay1(20)。 discan=0x00。 P0=table[ge]。 discan=scan_con[5]。 delay1(20)。 discan=0x00。 discan=scan_con[6]。 //位選 P0=0xc6。 //顯示 C delay1(20)。 discan=0x00。 } } } } } 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. 30 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 the