【正文】
障礙,從而使智能小車實(shí)現(xiàn)合理、安全的行走。 整個(gè)系統(tǒng)中,微控制器采用了Microchip公司的PIC16F877,軟件設(shè)計(jì)中涉及PORTB用作普通數(shù)字I/O腳和PORTC端口的CCP模塊的PWM脈寬調(diào)制輸出功能。小車使用編解碼芯片(pt2262ir/pt2272)焊制的紅外遙控系統(tǒng)控制小車,并在車體前后各安裝一個(gè)紅外探測傳感器實(shí)現(xiàn)校車的智能避障。Abstract In this experiment, we made a vehicle base on infrared detectable technology. You can remote control it under you if you chose the safe mode it can automatically avoid obstacles it may e across even if you are controlling it towards an obstacle. The system uses the production of the Microchip cordPIC16F877 as the microcontroller. The design includes the drive of PORTA and PORTD as general digital ports , the drive of PORTC as PWM(pulse width modulation) function. In conclusion, this experiment uses PIC16F877 cord to control volts . and acplish controlling’s condition of the vehile, and PWM function to control its turn. And this is so called safe car. 關(guān)鍵字單片機(jī)——microcontroller 芯片——CMOS chip 紅外探測——infrared detector 脈寬調(diào)制——pulse width modulation 安全小車—safe car 設(shè)計(jì)一個(gè)雙直流電機(jī)的智能小車。單片機(jī)控制口接兩個(gè)LM298的八個(gè)輸入控制端。9V電源在通常使用中,我們一般采用8位地址碼和4位數(shù)據(jù)碼,這時(shí)編碼電路PT2262和解碼PT2272的第1~8腳為地址設(shè)定腳,有三種狀態(tài)可供選擇:懸空、接正電源、接地三種狀態(tài),3的8次方為6561,所以地址編碼不重復(fù)度為6561組,只有發(fā)射端PT2262和接收端PT2272的地址編碼完全相同,才能配對(duì)使用,遙控模塊的生產(chǎn)廠家為了便于生產(chǎn)管理,出廠時(shí)遙控模塊的PT2262和PT2272的八位地址編碼端全部懸空,這樣用戶可以很方便選擇各種編碼狀態(tài),用戶如果想改變地址編碼,只要將PT2262和PT2272的1~8腳設(shè)置相同即可,例如將發(fā)射機(jī)的PT2262的第1腳接地第5腳接正電源,其它引腳懸空,那么接收機(jī)的PT2272只要也第1腳接地第5腳接正電源,其它引腳懸空就能實(shí)現(xiàn)配對(duì)接收。 控制信號(hào)遙控系統(tǒng)單片機(jī)紅外傳感器采集左電機(jī)路況信息右電機(jī)模式選擇系統(tǒng)軟件主框圖開始初始化安全模式? Y N自由模式子模塊安全模式子模塊 循環(huán) 循環(huán)圖8 系統(tǒng)主流程圖 自由模式子模塊控制按鍵按下? N 前 后 左 右減速前進(jìn)加速后退右輪不動(dòng)左輪前進(jìn)左輪不動(dòng)右輪前進(jìn)加速前進(jìn)減速后退圖9 自由模式子模塊遇障? Y N障礙檢測控制按鍵?