Cov txheej txheem:

Nyeem Ntawv Ultrasonic Sensor (HC-SR04) Cov ntaub ntawv ntawm 128 × 128 LCD thiab Pom Nws Siv Matplotlib: 8 Kauj Ruam
Nyeem Ntawv Ultrasonic Sensor (HC-SR04) Cov ntaub ntawv ntawm 128 × 128 LCD thiab Pom Nws Siv Matplotlib: 8 Kauj Ruam

Video: Nyeem Ntawv Ultrasonic Sensor (HC-SR04) Cov ntaub ntawv ntawm 128 × 128 LCD thiab Pom Nws Siv Matplotlib: 8 Kauj Ruam

Video: Nyeem Ntawv Ultrasonic Sensor (HC-SR04) Cov ntaub ntawv ntawm 128 × 128 LCD thiab Pom Nws Siv Matplotlib: 8 Kauj Ruam
Video: CARA MEMBUAT "DIGITAL DISTANCE METER" MENGGUNAKAN SENSOR ULTRASONIK HCSR04 2024, Kaum ib hlis
Anonim
Nyeem Ntawv Ultrasonic Sensor (HC-SR04) Cov ntaub ntawv ntawm 128 × 128 LCD thiab Pom Nws Siv Matplotlib
Nyeem Ntawv Ultrasonic Sensor (HC-SR04) Cov ntaub ntawv ntawm 128 × 128 LCD thiab Pom Nws Siv Matplotlib

Hauv cov lus qhia no, peb yuav siv MSP432 LaunchPad + BoosterPack los tso saib lub ntsuas hluav taws xob ultrasonic (HC-SR04) cov ntaub ntawv ntawm 128 × 128 LCD thiab xa cov ntaub ntawv mus rau PC ntu thiab pom nws siv Matplotlib.

Kauj ruam 1: Kho vajtse

Kho vajtse
Kho vajtse

Yam koj xav tau MSP432 LaunchPad, Kev Kawm BoosterPack MKII, Servo Motor, Ultrasonic Sensor (HC-SR04), Jumper Wires, Mini Breadboard.

Kauj ruam 2: Software

Software
Software

Energia IDED download: https://energia.nu/PyCharm Download:

Kauj Ruam 3: Teeb Kho Vajtse

Kho vajtse teeb
Kho vajtse teeb
Kho vajtse teeb
Kho vajtse teeb
Kho vajtse teeb
Kho vajtse teeb
Kho vajtse teeb
Kho vajtse teeb

S1. Txuas koj lub BoosterPack rau saum LaunchPad. S2. Txuas lub Ultrasonic sensor (HC -SR04) -> BoosterPack. Vcc -> pin 21 GND -> pin 22 Trig -> pin 33 Echo -> pin 32S3. Txuas lub Servo motor -> BoosterPack. Red -> POWERBlack -> GNDOrange -> SIGNAL (J2.19) S4. Txuas MSP432 LaunchPad rau ib qho ntawm koj lub computer USB chaw nres nkoj.

Kauj Ruam 4: Energia IDE

Energia IDE
Energia IDE
Energia IDE
Energia IDE

S1. Qhib Energia IDE. S2. Xaiv qhov tseeb chaw nres nkoj thiab board. S3. Rub cov program hauv qab no rau LaunchPad los ntawm txhaj rau pob Upload. Nws yog qhov program ua: P1. Nws tig lub servo motor los ntawm 0 txog 180 degrees thiab rov qab los ntawm 180 txog 0 degrees hauv cov qib ntawm 10. P2. Xam qhov nrug (cm) nyeem los ntawm lub ntsuas hluav taws xob ultrasonic thiab qhia nws ntawm 128 × 128 LCD. P3. Yog tias qhov nrug (cm) tsawg dua 20 tig rau Red LED lwm tus tig rau Green LED. P4. Tsuas yog ua si ib puag ncig nrog lub vijtsam LCD hauv qhov chaw, txoj haujlwm tseem qhia qee qhov duab geometrical.

Kauj Ruam 5: Energia IDE - Sketch

Energia IDE - Sketch
Energia IDE - Sketch
Energia IDE - Sketch
Energia IDE - Sketch

Daim duab saum toj no tuaj yeem rub tawm los ntawm no.

Kauj Ruam 6: Plotting Cov Ntaub Ntawv

Plotting cov ntaub ntawv
Plotting cov ntaub ntawv
Plotting cov ntaub ntawv
Plotting cov ntaub ntawv
Plotting cov ntaub ntawv
Plotting cov ntaub ntawv

Koj tuaj yeem siv ib qho Python IDE, hauv qhov no kuv siv PyCharm. Ua ntej koj pib, nco ntsoov tias cov hauv qab no tau ua tiav:-> Koj tau teeb tsa Python. Koj tuaj yeem tau txais los ntawm: https://www.python.org/downloads/-> Koj tab tom ua haujlwm nrog PyCharm Community. I. Tsim cov ntawv Python hauv PyCharmS1. Cia peb pib peb txoj haujlwm: yog tias koj nyob ntawm Lub Vev Xaib Zoo Siab, nyem Tsim Qhov Haujlwm Tshiab. Yog tias koj twb tau txais txoj haujlwm qhib, xaiv Cov Ntaub Ntawv -> Txoj Haujlwm Tshiab. S2. Xaiv Ntshiab Python -> Qhov Chaw (Qhia meej cov npe) -> Tus Neeg txhais lus Project: Tshiab Virtualenv Ib puag ncig -> Virtualenv cuab yeej -> Tsim. S3. Xaiv lub hauv paus phiaj xwm hauv qhov Project tool window, tom qab ntawv xaiv File -> New -> Python file -> Type the new filename. S4. PyCharm tsim cov ntawv Python tshiab thiab qhib nws rau kho kom raug. II. Nruab cov pob hauv qab no: PySerial, Numpy thiab Matplotlib. S1. Matplotlib yog lub tsev qiv ntawv npaj rau Python. S2. NumPy yog lub hauv paus pob rau kev suav ua lej hauv Python. S3. PySerial yog Python lub tsev qiv ntawv uas muab kev txhawb nqa rau kev sib txuas txuas nrog ntau yam khoom siv sib txawv. II Txhawm rau teeb tsa ib pob hauv PyCharmS1. Cov ntaub ntawv -> Chaw. S2. Hauv Txoj Haujlwm, xaiv Txoj Haujlwm Txhais Lus thiab nyem rau ntawm lub cim "+". S3. Hauv kab ntawv tshawb nrhiav, ntaus pob koj xav nruab thiab nyem rau ntawm Install Package.

Kauj ruam 7: Python Program

Python Program
Python Program

NCO TSEG: Nco ntsoov tias tus lej COM chaw nres nkoj thiab tus nqi baud zoo ib yam li hauv daim duab Energia. Qhov kev pab cuam saum toj no tuaj yeem rub tawm los ntawm no.

Kauj ruam 8: Kawg

Image
Image
Kawg!
Kawg!
Kawg!
Kawg!

Nyob ntawm koj thaj chaw ib puag ncig, koj yuav tsum pib pom qhov ntsuas ntsuas (cm) ntawm ntau yam khoom ntawm LCD zaub raws li lub cav servo tig los ntawm 0 txog 180 degrees thiab rov qab los ntawm 180 txog 0 degrees. Python txoj haujlwm qhia pom lub tswv yim nyob ntawm lub ntsuas hluav taws xob ultrasonic nyeem ntawv. /devdocs/user/quickstart.htmlUltrasonic Distance Sensor-HC-SR04: https://www.sparkfun.com/products/15569MSP432 LaunchPad: https://www.ti.com/tool/MSP-EXP432P401REducational BoosterPack MKII: https://www.ti.com/tool/BOOSTXL-EDUMKIIServo Tsav:

Pom zoo: