【正文】
意見和建議。雖然在設(shè)計(jì)中對于知識的運(yùn)用和銜接還不夠熟練。這三個月的設(shè)計(jì)是對過去所學(xué)知識的系統(tǒng)提高和擴(kuò)充的過程,為今后的發(fā)展打下了良好的基礎(chǔ)。最后,再次向給予我指導(dǎo)和幫助的老師和各位同學(xué)表示最誠摯的謝意!附錄1:附錄2:includedefine uchar unsigned chardefine uint unsigned intuchar pro_left=35,pro_right=35,i,j。sbit left2=P2^0。sbit right2=P2^2。sbit pright=P2^6。 sbit en2=P1^1。 //白線位置sbit right_red=P1^4。 while(z) {for(i=0。i++)。 //白線位置right_red=0。TH0=(65536100)/256。EA=1。TR0=1。en2=1。j++。} else en1=0。i=0。} else en2=0。j=0。TL0=(65536100)%256。pro_left=20。left2=0。right2=0。pro_left=20。left2=0。right2=0。pro_left=0。left2=0。right2=0。left2=1。right2=1。pro_left=20。if((pright==1)||(pleft==1)){ if((left_red==1)amp。} else if((right_red==1)amp。} else if((left_red==0)amp。} else {flag=0。(pleft==1)) {flag=4。(pleft==0)) {flag=5。(pleft==0)) {flag=6。}switch (flag) { case 0:straight()。 case 1:turn_right()。 break。 delay(1000)。 case 3:straight()。 break。 delay(1000)。 delay(1000)。 case 5:turn_back()。 turn_right()。 break。 delay(1000)。 delay(1000)。 default: break。 delay(1)。 }} The design of smart car designed based on the STC89C52xialongwei Directed By JiangLifeiAbstract This article introduced a smart car designed based on the STC89C52. The car is capable of identifying black and obstacle, so it can run in a fixed area and automatic obstacle avoidance. The car take STC89C52 as it’s controller。 The car can change it’s direction and speed by the singlechip generated PWM wave and L298N. Keywords STC89C52 Single chip microputer Infrared sensor PWM L2