Cov txheej txheem:

Saib Xyuas Dej Nrog Raspberry Pi: 4 Kauj Ruam
Saib Xyuas Dej Nrog Raspberry Pi: 4 Kauj Ruam

Video: Saib Xyuas Dej Nrog Raspberry Pi: 4 Kauj Ruam

Video: Saib Xyuas Dej Nrog Raspberry Pi: 4 Kauj Ruam
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Kaum ib hlis
Anonim
Image
Image

Taw qhia

Nyob zoo txhua tus, Kuv yog Shafin, tus tswv cuab ntawm Aiversity. Kuv yuav qhia txog yuav tsim lub ntsuas dej li cas rau cov tso dej nrog Raspberry pi. Txoj haujlwm no yuav pab koj nkag siab txog kev ua haujlwm ntawm Raspberry pi kom ntxaws.

Khoom siv

Thoob

Dej Dej

Raspberry pib

Buzzer

Jumper Hlau

Ultrasonic Sensor

Kauj ruam 1: Kev sib txuas

Qauv
Qauv

Kev sib txuas

Tam sim no cia tham txog kev sib txuas ntawm raspberry pi, ultrasonic sensor thiab Buzzer. Please ua raws daim duab qhia chaw raws li muab

Kev Sib Txuas:

Ultrasonic sensor vcc rau 5v ntawm Raspberry Pi

Ultrasonic sensor Gnd rau Gnd ntawm Raspberry Pi

Ua rau GPIO 2

Echo rau GPIO 3

Buzzer + rau GPIO 4

Buzzer - rau Gnd

Kauj Ruam 2: Qauv

Qauv

· Txuas tus nplai rau lub thoob.

· Tom ntej txuas lub buzzer thiab ultrasonic sensor rau qhov ntsuas

Kauj ruam 3: Code

Code

Tam sim no koj paub kev sib txuas thiab tus qauv, cia peb tsim txoj cai.

1. Qhib Thonny Python IDE

2. Rub tawm Github code:-https://github.com/Aiversity/Raspberry-pi-project..

3. Qhib thiab khiav cov cai.

Kauj ruam 4: Xeem

Kev Xeem
Kev Xeem

Kev Xeem

Sau dej rau hauv lub thoob. Thaum qhov deb ntawm ultrasonic sensor los ntawm cov dej nyob ib puag ncig 4 centimeter, lub buzzer yuav beep, ceeb toom lub thoob yuav luag tag nrho.

Yog tias koj muaj lus nug, thov nug ntawm [email protected]

Xav paub ntau ntxiv, mus saib

Pom zoo: