【正文】
reak。 break。0xfe。 time1=zhuansu*60。 led2=0。 P0 = LED_CODE[qian]。 delay_1ms(200)。i75。這次畢設(shè)不僅用到很多新知識,而且我也用到了許多大學(xué)四年里學(xué)到的知識。在 Keil 的編譯系統(tǒng)里,我們每次單獨(dú)的寫入一段程序系統(tǒng)都被默認(rèn)為工程。 Proteus 在畫出原理電路圖后,就能寫入事先通過 Keil 軟件寫好的 *.HEX文檔了,這樣就可以看到各部件的工作狀態(tài)和過程。 圖 21 報警模塊電路 數(shù)碼管顯示電路 LED 就是發(fā)光二極管的縮寫,每個數(shù)碼管都由 8只發(fā)光二極管組成,用小寫字母 a、 b、 c、 d、 e、 f、 g、 dp 對它們分別進(jìn)行標(biāo)記,其中 dp 表示小數(shù)點(diǎn),每個發(fā)光二極管的其中一根電極都會引到外部的引腳上此引腳就被標(biāo)記為 COM 公共端。這種測量距離的方法是完全可以通過主被動兩種方法來實(shí)現(xiàn)的。而軟件生成法操作起來就比硬件調(diào)制法簡單多了,我們只需加一個 PWM 調(diào)制到系 13 統(tǒng)控制程序里就能達(dá)到目的了。它主要有以下優(yōu)點(diǎn): ( 1)晶閘管只在開關(guān)狀態(tài)下工作,而相位就難以控制它的導(dǎo)電性。 ( 3)具有特殊性的開發(fā)平臺。與通用微處理器相同的是AT89C51 單片機(jī)里的 8 位微處理器也包含了運(yùn)算器和控制器兩個部分,在進(jìn)行面向控制的同時,還可以進(jìn)行數(shù)據(jù)處理和位變量操作。在單片機(jī)內(nèi)部只要有脈沖信號時序電路就能工作,其中時鐘產(chǎn)生電路有內(nèi)部振蕩和外部振蕩兩種方式。 圖 2 為智能小車的系統(tǒng)框圖。 3 第二章 總體方案設(shè)計 本次畢設(shè)用的是直流減速電機(jī),控制電機(jī)驅(qū)動部分用的是電機(jī)專用的驅(qū)動芯片 L298N,用 AT89C51 單片機(jī)作為系統(tǒng)控制的核心,通過超聲波傳感器和反射式紅外光電傳感器分別實(shí)現(xiàn)小車的測距以及自動循跡功能。 關(guān)鍵詞:智能小車; 51 單片機(jī);尋跡;避障 II Smart Electric Ear Design ABSTRACT In today39。s society, new trends and main trends of electronic products in the electronics industry are intelligent. Intelligent gradually into our lives, in our lives adds a lot of fun, it also brings a lot of convenience, more and more people of all ages. And now widely used in environmental monitoring, scientific investigation, smart home and other aspects of intelligent electronic products is not required that the administration, that is, before they run automatically according to set a good model in an environment. The plete set is an 89C51 microcontroller to do the electric smart car model based on good indication of this. Mainly related to the carriage of PWM control, intelligent tracking and Ultrasonic Ranging obstacle avoidance function. By infrared sensors to collect road information to automatically control rotation of the motor in order to achieve change and obstacle avoidance car travel route, and when the small car ultrasonic sensor detects an obstacle, the buzzer alarm will be sent immediately Didi tick sound harsh. With the ultrasonic transmitter circuit and reception circuit reuse digital ultrasonic signal to show the distance between emission points and obstacles in order to achieve the car Ultrasonic Ranging function. Keywords: intelligent car; 51 MCU; tracing; avoidance III 目 錄 前 言 ............................................................................................................................... 1 第一章 緒論 ................................................................................................................... 2 課題研究的背景和意義 ....................................................................................... 2 課題研究內(nèi)容 ................................................................................................... 2 第二章 總體方案設(shè)計 ..................................................................................................... 3 主 控系統(tǒng) .......................................................................................................... 3 小車驅(qū)動系統(tǒng) ................................................................................................... 3 系統(tǒng)框圖 .......................................................................................................... 3 系統(tǒng)原理圖 ...................................................................................................... 4 第三章 系統(tǒng)硬件設(shè)計 ...................................................................................................... 6 單片機(jī)硬件結(jié)構(gòu) .............................................................................................. 6 單片機(jī)的選擇 .......................................................................................... 6 單片機(jī)引腳功能 ....................................................................................... 7 結(jié)構(gòu)特點(diǎn) ................................................................................................. 8 最小應(yīng)用系統(tǒng)設(shè)計 ................................................................................... 9 時鐘電路 ............................................................................................... 10 復(fù)位電路 ................................................................................................11 直流調(diào)速系統(tǒng) ..................................................................................................11 L298N芯片直流電機(jī)驅(qū)動模塊 ......................................................................... 13 超聲波測距避障模塊 ............................................