【正文】
} Void offmsd() //百位為0判斷模塊 { if (buffer[0] == 0xC0) buffer[0] = 0xFF。 s=sj2。 if(sj1100) sj1=50。break。 } } xx=0。 xx++。 sj1=sj1+10。 sj1=40。 csbint=1。 t=t29。 TH1=0x9E。 while(i) { } i=0。 TL0=0x00。 if(csbds=40) { csbds=0。 } void delay(i) { while(i)。 xm2=s100*xm010*xm1。 delay(200)。 delay(200)。 delay(200)。 //顯示函數(shù) if(ssj1) bg=0。 } else timeToBuffer()。 buffer[0]=0xC6。 while(1) { keyscan()。/////////測(cè)試報(bào)警距離 sj2=200。 cl=0。 TH1=0x9E。 //開中斷 TMOD=0x11 //設(shè)定時(shí)器0為計(jì)數(shù),設(shè)定時(shí)器1定時(shí) ET0=1。 void k3cl()。 //顯示函數(shù) void timeToBuffer()。unsigned int s,t,i,xx,j,sj1,sj2,sj3,mqs,sx1。 //LED控制 sbit LED2=P2^5。 sbit csbout=P1^0。參考文獻(xiàn) [1] :2003年6月[2] :1998年[3] . 廣東江門:2006年[4] :2000年12月[5] 龔運(yùn)新 單片機(jī)C語(yǔ)言開發(fā)技術(shù) 清華大學(xué)出版社 2006年10月[6] 段晨東 單片機(jī)原理及接口技術(shù) 清華大學(xué)出版社 2008年8月[7] 戴佳 51單片機(jī)C語(yǔ)言應(yīng)用程序設(shè)計(jì)實(shí)例精講第二版 電子工業(yè)出版社 2009年11月[8] (第2版)北京:[9] 周良權(quán),傅恩錫,(第二版)北京:高等教育出版社 3[10] [11] 邱平. [12] :電力工業(yè)出版社,1980年[13] 李鳴華,. 電子技術(shù)應(yīng)用,1998年Based on SCM car anticollision system designThe College of Physics and Information Engineering07 class electronics information science and technology 070303049 gan jingchangFaculty adviser Zhu Chengquan lecturer【Abstract】This paper introduces the properties and the characteristics of AT89S51, designs a impactproof alarm with low cost, high precision, miniaturization, digital display taking it as the core . The impactproof alarm takes SCM’s realtime control and data processing functions bine with the Ultrasonic ranging technology,the sensor technologies. It is able to detecte the distance of rear obstacle and the automobile, through digital display device shows by sound circuit distance, and according to the distance situation warned. It has the vital significance to prevent automobile reverse accident.【 keywords 】 Microcontroller。系統(tǒng)結(jié)構(gòu)簡(jiǎn)單、體積小、實(shí)時(shí)LED顯示和報(bào)警、抗干擾能力好等優(yōu)點(diǎn)。誤差來源由于聲速與溫度