Cov txheej txheem:

Dej Saib Xyuas Dej Siv Oled Zaub Nrog Raspberry Pi: 4 Cov Kauj Ruam
Dej Saib Xyuas Dej Siv Oled Zaub Nrog Raspberry Pi: 4 Cov Kauj Ruam

Video: Dej Saib Xyuas Dej Siv Oled Zaub Nrog Raspberry Pi: 4 Cov Kauj Ruam

Video: Dej Saib Xyuas Dej Siv Oled Zaub Nrog Raspberry Pi: 4 Cov Kauj Ruam
Video: Musicians talk about Buckethead 2024, Kaum ib hlis
Anonim
Image
Image

Nyob zoo txhua tus, Kuv yog Shafin, tus tswv cuab ntawm Aiversity. Kuv tab tom yuav qhia txog yuav ua li cas txhawm rau ntsuas lub ntsuas dej nrog Oled zaub rau cov tso dej tso nrog Raspberry pi. Cov zaub oled yuav qhia feem pua ntawm lub thoob ntim nrog dej.

Khoom siv

Cov khoom siv kho vajtse

Raspberry Pi 3 Qauv B.

Buzzer

Ultrasonic Sensor - HC -SR04 (Generic)

ElectroPeak 0.96 OLED 64x128 Display Module

Jumper xov hlau (generic)

Dej Dej

Thoob

Kauj ruam 1: Kev sib txuas

Qauv
Qauv

Tam sim no cia peb tham txog kev sib txuas ntawm raspberry pi, ultrasonic sensor, oled zaub thiab lub suab nrov.

Thov ua raws daim duab qhia chaw.

Kev Sib Txuas:

Ultrasonic sensor vcc rau 5v ntawm Raspberry Pi

Ultrasonic sensor Gnd rau Gnd ntawm Raspberry Pi

Ua rau GPIO 14

Ncha mus rau GPIO 15

Buzzer + rau GPIO 4

Buzzer - rau Gnd

Sda ntawm Oled zaub rau Gpio 2 ntawm Raspberry Pi

Scl ntawm Oled zaub rau Gpio 3 ntawm Raspberry Pi

Vcc ntawm Oled zaub rau 3.3v ntawm Raspberry Pi

Gnd ntawm Oled zaub rau Gnd ntawm Raspberry Pi

Kauj Ruam 2: Qauv

· Txuas tus nplai rau lub thoob.

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

Kauj ruam 3: 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 hauv qab no lossis los ntawm qhov kawg ntawm nplooj ntawv:-https://github.com/Aiversity/Raspberry-pi-project…

3. Khiav cov cai

4. Koj yuav tau ntxiv koj qhov nrug deb ntawm lub ntsuas cua ultrasonic mus rau lub hauv paus ntawm lub thoob ntawm kab: Kab 25. dist_from_base = #Sau qhov kev ncua deb ntawm lub ntsuas cua mus rau lub hauv paus ntawm lub thoob

Kauj ruam 4: 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 thiab cov oled zaub yuav qhia feem pua ntawm lub thoob ntim.

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

Xav paub ntau ntxiv, mus saib Aiversity.com.

Pom zoo: