Cov txheej txheem:

Magdalena thiab Brenton INSTRUCTABLE: 3 Kauj Ruam
Magdalena thiab Brenton INSTRUCTABLE: 3 Kauj Ruam

Video: Magdalena thiab Brenton INSTRUCTABLE: 3 Kauj Ruam

Video: Magdalena thiab Brenton INSTRUCTABLE: 3 Kauj Ruam
Video: Cyndi Lauper - Girls Just Want To Have Fun (Official Video) 2024, Hlis ntuj nqeg
Anonim
Magdalena thiab Brenton INSTRUCTABLE
Magdalena thiab Brenton INSTRUCTABLE

Txog qhov haujlwm no, Brenton thiab kuv tau siv lub ntsuas hluav taws xob ultrasonic siv sonar txhawm rau txiav txim siab qhov nrug mus rau ib qho khoom. Lub hauv paus ntawm qhov no ua haujlwm li cas yog tus xa lossis tus (trig pin) yuav xa lub teeb liab zoo li lub suab nrov ntau, tom qab ntawd thaum lub teeb liab pom cov khoom nws tau pom thiab tau txais los ntawm tus xa (tus ncho tus pin). Paub txog cov suab nrawm hauv huab cua, lub sijhawm sib kis thiab txais tos, tso cai rau peb xam qhov deb mus rau ib yam khoom.

Khoom siv

Koj yuav xav tau Arduino lub rooj noj mov, lub laptop, arduino ultrasonic sensor, peb lub xov hlau txuas, thiab Circuit, usb rau txuas lub Circuit Court mus rau lub laptop uas peb tso cov cai.

Kauj ruam 1: Tsim Sonar

Tsim Sonar
Tsim Sonar

Txhawm rau tsim lub sonar koj yuav xav tau cov ntaub ntawv teev tseg hauv ntu khoom siv ntawm qhov kev taw qhia. Txhawm rau pib koj yuav siv koj lub khoos phis tawj los tsim cov cai txhawm rau ua haujlwm ultrasonic sensor sonar. Txhawm rau tsim cov cai koj yuav xub ua ntej koj tsim qhov hloov pauv rau tus txhais thiab echo tus pin hu ua trigPin thiab echoPin, feem. Tus ntsuas tus pin txuas nrog digital Pin 9, thiab tus echo pins txuas nrog digital Pin 10. Koj tseem yuav xav tsim lub sijhawm sib txawv. Nws yuav txuag lub sijhawm nyob nruab nrab ntawm kev tso tawm thiab xa tawm cov cai. Hauv kev teeb tsa () koj yuav tsum tau pib nws ntawm 9600 yog li koj yuav muaj Serial. Begin (9600). Koj kuj tseem yuav xav tau lub voj los pib LOW thiab Cov txiaj ntsig siab ntawm 2 thiab 10.

Kauj ruam 2: Teeb

Teeb
Teeb

Txhawm rau tsim teeb tsa, koj yuav xav tau cov khoom teev hauv cov khoom siv ntawm ntu kev taw qhia. Koj yuav tsum tau nkag mus rau lub ntsuas hluav taws xob ultrasonic mus rau lub khob cij. tom qab ntawd koj yuav xav tau lub jumper xaim txuas VCC los ntawm lub sensor mus rau 5V ntawm Circuit Court. Tom qab ntawv xaim txuas Trig tsim lub sensor rau Pin 9 thiab ib qho txuas Echo rau Pin 10. Thaum kawg, koj yuav tsum txuas GND los ntawm lub sensor mus rau GND ntawm Circuit.

Kauj ruam 3: Troubleshooting

Koj yuav tsum tau khiav cov cai thiab ntsuas yog tias nws raug thiab ua haujlwm. Lub sensor yuav ua haujlwm txog 10 ko taw nrog tag nrho txoj kev nrug ntawm 20 ft thiab txwv 20ms, yog li lub sijhawm yuav tsum tau teeb tsa siab dua 20ms. Qee yam ntxiv uas yuav tsum nco ntsoov yog tias lub ntsuas tsis tuaj yeem tau txais Echo, tom qab ntawd koj li OUTPUT tsis tuaj yeem qis dua.

Pom zoo: