(精品)基于单片机的超声波测距仪的设计参考毕业论文 下载本文

uchar i; uchar j=0xfe; dispbuf[3]=11; dispbuf[2]=11; dispbuf[1]=11; dispbuf[0]=0; for(i=0;i<4;i++) { P0=0xff; P0=ledcode[dispbuf[i]]; P2=j; delay10ms(1); j=(j<<1)+0x01; } }

void timer1(void)interrupt 3 {

TR1=0; TH1=0x00; TL1=0x00; }

void timer0(void)interrupt 1 {

send=!send; TH0=0x1f; TL0=0xf4; }

void int1(void)interrupt 2 {

if(TH1!=0x00&&TH0!=0x00) {

b=1; TR1=0; TR0=0;

t=TH1*256+TL1; t=t;

TH0=0x1f; TL0=0xf4; TH1=0x00; TL1=0x00; } else {

b=0;

*输送显示数据*

TR1=0; TR0=0; TH0=0x1f; TL0=0xf4; TH1=0x00; TL1=0x00; } }

main() {

unint i;

EA=1; 开中断

TMOD=0x10; 设定时器0、定时器1都工作在定时状态,T0方式0,T1方式1

ET0=1; 定时器0中断允许 ET1=1; 定时器1中断允许 IT1=0; 外部中断1低电平有效 TH0=0x1f; TL0=0xf4; TH1=0x00; TL1=0x00; send=1; receive=1; k1=1; k2=1; while(1) {

dis2();

if(k1!=1) 判断k1是否按下,按下则开始执行温度转换和测距操作 {

delay(100); 消抖 if(k1!=1) {

tmpchange(); 启动温度转换 tmp();

EX1=1; 外部中断1中断允许 TR0=1; T0定时开始 TR1=1; T1定时开始 delay10ms(7); distance(); EX1=0; while(1) {

dis1();

if(k2!=1) {

delay(100); if(k2!=1) {

for(i=0;i<200;i++) { tmpchange(); tmp(); dis(); } } } if(k3!=1) {

delay(100); if(k3!=1) break; } } } } } }

附录3 外文复印件

Ultrasonic wave production:

The sound wave is the object mechanical vibrations condition (or energy) dissemination form. The so-called vibration is refers to material the particle the

reciprocating motion which carries on nearby its position of equilibrium. For example, drum surface after rap, it on all directions through the air medium, this is a sound wave. The ultrasonic wave is refers to the vibrational frequency to be bigger than above 20KHz, its each second vibration number of times (frequency) very ear sense of Sheng be essentially consistent, their common ground is one kind of mechanical vibrations, usually will disseminate by the longitudinal wave way in the elastic medium, will be one kind of energy dissemination form, its diversity will be the

ultrasonic frequency is certain distance along the straight line dissemination and the directivity, at present the abdomen supersonic image formation will use the frequency range in 2~5MHz, (will vibrate 1 time for 3~3.5MHz each second is 1Hz,1MHz=106Hz commonly used, namely each second will vibrate times, but Wen Bo frequency between HZ).

Two main parameters about ultrasonic wave:

Two main parameters about ultrasonic wave are: Frequency: F≥20KHz; Power density: p= emissive power (W)emitting area (cm2); Usually p≥0.3wcm2; The

supersonic wave energy which disseminates in the liquid carries on the clean to the object surface's contamination, its principle available “the cavitation” the

phenomenon explained: The ultrasonic wave vibration disseminates when the liquid the sound wave intensity of pressure which achieves an atmospheric pressure, its power density is 0.35wcm2, by now the ultrasonic wave sound wave intensity of pressure peak value might achieve the vacuum or the negative pressure, but in fact does not the liquid, becomes the empty cavitation nucleus the liquid member tension fracture. This cavity very close vacuum, it when the ultrasonic wave intensity of pressure achieves reverse is biggest bursts, as a result of bursts the intense impact which produces to . This kind the shock-wave phenomenon which produces by the innumerable tiny cavitation air bubble collapse is called “the cavitation” the phenomenon.

The function of ultrasonic wave:

The glass components, the glass and ceramic article's removing dirty stuff is terrible business, if puts in these goods in the cleaning liquid, passes over the

ultrasonic wave again, on the cleaning liquid fierce vibration impact goods dirt, can clean cleanly very quickly.

Although said that the to the favorable balance of trade sound wave, but many animals actually the garden, why the luminous situation soared, but will not lose the direction? The reason is the bat can send out 2 ~ ”. The bat is precisely uses this kind “the radar” front the judgment flight is an insect, perhaps obstacle. But radar's quality some important performance precision. Antijamming ability and so on, bat far superior and modern wireless beacon. On the deep research animal body each