Cov txheej txheem:

Motion Decting Nerf Gun: 8 Kauj Ruam
Motion Decting Nerf Gun: 8 Kauj Ruam

Video: Motion Decting Nerf Gun: 8 Kauj Ruam

Video: Motion Decting Nerf Gun: 8 Kauj Ruam
Video: NERF GUN WAR 8 2024, Hlis ntuj nqeg
Anonim
Motion Decting Nerf Phom
Motion Decting Nerf Phom

Nyob zoo! Kuv yog Cameron. Txog qhov Qhia Qhia Kuv qhia koj yuav ua li cas thiaj ua kom muaj zog qhib Nerf phom. Nws nyuaj me ntsis, tab sis 100% AWESOME !!!

Khoom siv

1. hluav taws xob Nerf rab phom

2. Raspberry Pi (b+ thiab tshiab dua)

3. Lub txhab nyiaj roj teeb (2 amp thiab siab dua)

4. PIR module (5 volts)

5. relay (Kuv siv Songle SRD-05VDC-SL-C)

6. cov khoom me me thiab cov khoom (daim ntawv qhia zaub mov, jumper xov hlau, daim npav micro sd, thiab lwm yam)

Kauj Ruam 1: Rho phom rab phom

Ntsia rab phom
Ntsia rab phom

Cov kauj ruam no yog tej zaum qhov yooj yim tshaj plaws hauv cov lus qhia no. Tsuas yog ntswj tag nrho cov ntsia hlau (sab nraud nkaus xwb!).

Kauj Ruam 2: Tshem Tawm Cov Roj Teeb

Tshem Tawm Cov Roj Teeb
Tshem Tawm Cov Roj Teeb

Cov kauj ruam no nyuaj nyuaj rau kuv rab phom Nerf. Tshem tag nrho cov ntsia hlau thiab lossis kua nplaum.

Kauj Ruam 3: Txuas Lub Roj Teeb Los Ntawm Nerf Phom

Txuas lub Roj Teeb Pob Los Ntawm Nerf Phom
Txuas lub Roj Teeb Pob Los Ntawm Nerf Phom
Txuas lub Roj Teeb Pob Los Ntawm Nerf Phom
Txuas lub Roj Teeb Pob Los Ntawm Nerf Phom
Txuas lub Roj Teeb Pob Los Ntawm Nerf Phom
Txuas lub Roj Teeb Pob Los Ntawm Nerf Phom

Yooj yim! Nqa qhov tsis zoo ntawm lub roj teeb mus rau qhov tsis zoo ntawm rab phom Nerf, tom qab ntawd qhov zoo mus rau qhov nruab nrab ntawm koj qhov kev xa xov (nws yog lub hauv paus ntawm kuv, tab sis koj yuav xav tau ob zaug xyuas kom paub tseeb).

Kauj Ruam 4: Txuas MOTORS

Txuas lub MOTORS !!
Txuas lub MOTORS !!

Txuas cov xov hlau zoo ntawm cov phom Nerf mus rau NO (Feem Ntau Qhib) ib feem ntawm kev xa tawm (kuv yog sab xis).

Kauj Ruam 5: Txuas tus Relay

Txuas lub Relay
Txuas lub Relay
Txuas lub Relay
Txuas lub Relay
Txuas lub Relay
Txuas lub Relay

Nqa cov ntaub ntawv tus pin ntawm kev xa mus rau GPIO 21 (hauv qab txoj cai) ntawm Raspberry Pi, GND txog rau hauv av, thiab 5V txog 5V.

Kauj Ruam 6: Nqa PIR

Sib Nqus PIR
Sib Nqus PIR
Sib Nqus PIR
Sib Nqus PIR
Sib Nqus PIR
Sib Nqus PIR

Nqa cov ntaub ntawv tus pin ntawm PIR mus rau GPIO tus pin 4, GND rau hauv av, thiab thaum kawg 5V txog 5V.

Kauj Ruam 7: Code Nws Nrog Python

Code Nws Nrog Python
Code Nws Nrog Python

########################################################################################## ###################

print ("Zoo siab! (Tsis raug) GPIO.setmode (GPIO. BCM GPIO.setup (21, GPIO. OUT) pw (0.3) luam ("Ua tiav !!") pw tsaug zog (0.1) luam tawm ("Thov tos kom PIR daws …") pir. wait_for_no_motion pw tsaug zog (1) luam tawm ("daws teeb meem!") thaum Tseeb: luam tawm ("Npaj rau hluav taws …") pir.wait_for_motion () luam tawm ("Tsab ntawv tsa suab pom !!!") luam tawm ("Hluav Taws !!!") GPIO. tso tawm (21, Tseeb) pw tsaug zog (1) luam tawm ("Hwj chim tawm") GPIO.output (21, Tsis tseeb)

Kauj ruam 8: Qhib Nws

Qhib Nws!
Qhib Nws!

Cov kauj ruam:

1. khi tus txhais nrog hlua kom nws tau nyam rau ntawm txoj haujlwm

2. khiav Python code

3. khiav tawm… LOS YOG TSEV !!!

Kuv vam tias koj nyiam qhov Qhia Ntawv no, bye!

-Cameron

Pom zoo: