Cov txheej txheem:

Raspberry Pi Lub Suab Tswj Hauv Tsev Automation: 5 Kauj Ruam
Raspberry Pi Lub Suab Tswj Hauv Tsev Automation: 5 Kauj Ruam

Video: Raspberry Pi Lub Suab Tswj Hauv Tsev Automation: 5 Kauj Ruam

Video: Raspberry Pi Lub Suab Tswj Hauv Tsev Automation: 5 Kauj Ruam
Video: Get Started → Learn English → Master ALL the ENGLISH BASICS you NEED to know! 2024, Kaum ib hlis
Anonim
Raspberry Pi Voice Controlled Tsev Automation
Raspberry Pi Voice Controlled Tsev Automation

Lub hom phiaj ntawm cov lus qhia no yog los qhia ib qib zuj zus qhia yuav ua li cas teeb tsa raspberry pi uas tuaj yeem siv teeb / teeb nrog koj lub suab txib.

Kauj Ruam 1: Kauj Ruam 1: Yam Khoom / Khoom Uas Koj Xav Tau

Kauj Ruam 1: Yam Khoom / Khoom Uas Koj Xav Tau
Kauj Ruam 1: Yam Khoom / Khoom Uas Koj Xav Tau

1. Raspberry Pi 3 nrog Noobs / Raspbian Os.

2. A USB webcam nrog lub microphone / USB microphone

3. windows / linux pc kom nkag tau Raspberry pi

Kauj Ruam 2: Teeb Mic kom Tshawb Pom Lub Suab

Teeb Meem Kom Pom Lub Suab
Teeb Meem Kom Pom Lub Suab
Teeb Meem Kom Pom Lub Suab
Teeb Meem Kom Pom Lub Suab

Ua ntej, peb yuav tsum txheeb xyuas seb koj lub microphone lossis lub vev xaib raug kuaj pom los ntawm Raspberry Pi thiab lub ntim ntawm lub microphone yog siab. Thawj kauj ruam yog txheeb xyuas koj lub vev xaib lossis lub microphone tau teev tseg siv cov lus txib "lsusb".

Daim duab 1: Txheeb xyuas Webcam lossis Microphone Pom Los Ntawm Raspberry Pi

Cov kauj ruam tom ntej yog teeb tsa lub microphone kaw ntim siab. Txhawm rau ua qhov no, nkag mus rau lo lus txib "alsamixer" hauv lub davhlau ya nyob twg. Ib lub vijtsam graphical interface zoo qhia pom, nias lub pob kom nce lossis nqis kom teeb tsa lub ntim. Nias F6 (tag nrho), tom qab ntawd xaiv lub webcam lossis microphone los ntawm cov npe. Ib zaug ntxiv siv tus xub xub yuam kom teeb tsa lub kaw suab kom siab.

Daim duab 2: Teeb Microphone Volume Siab

Kauj Ruam 3: Teeb Gpio Pins

Teeb tsa Gpio Pins
Teeb tsa Gpio Pins
Teeb tsa Gpio Pins
Teeb tsa Gpio Pins

Txhawm rau nkag mus rau GPIO Pins koj yuav tsum tau teeb tsa Wiring Pi ntawm koj li Raspberry Pi

sudo apt-tau nruab git-core

git clone git: //git.drogon.net/wiringPi

cd kab w

./ tsim

rau cov lus qhia ntxiv koj tuaj yeem saib ntawm cov screenshots

Kauj ruam 4: Sau Ntawv

Tsim cov ntawv hauv qab no ua cov npe hu ua 'coj':

#!/bin/tsoo

yog [$#> 1]

ces

/usr/local/bin/gpio hom 4 tawm

yog

ces

/usr/local/bin/gpio sau 4 rau

fi ua

yog

ces

/usr/local/bin/gpio sau 4 tawm

fi ua

fi ua

Teem tsab ntawv kom ua tiav nrog cov lus txib hauv qab no:

chmod u+x coj

Tam sim no cov lus txib no yuav tsum ON LED txuas nrog tus pin. (Tus lej tus lej piav qhia tuaj yeem nrhiav tau hauv Wiring Pi page).

./live rau

Txhawm rau tua OFF cov lus txib no tuaj yeem siv

./ua tsaug

Kauj Ruam 5: Txhim Kho Lub Suab Pom Zoo Software rau Raspberry Pi:

Txhim Kho Lub Suab Pom Zoo Software rau Raspberry Pi
Txhim Kho Lub Suab Pom Zoo Software rau Raspberry Pi

Voice Command teeb tsa ua ib feem ntawm kev sau cov pob khoom. Peb, tsuas yog xav tau kev vam khom thiab lub suab hais kom ua rau cov lus qhia no. Thaum teeb tsa tsab ntawv sau, nws yuav nug koj qhov xav kom teeb tsa ntau pob uas koj tuaj yeem tsuas yog hais yog rau kev vam khom thiab lub suab hais kom ua.

Ua cov lus txib hauv qab no:

git clone git: //github.com/StevenHickson/PiAUISuite.git

cd PiAUISuite/Nruab/

./InstallAUISuite.sh

Tom qab Lub Suab Hais kom ua nruab, nws yuav hais kom koj teeb tsa. Xaiv yog los tso cai rau nruab tsab ntawv kom pib teeb tsa. Thaum teeb tsa tiav nws yuav qhia koj kom hloov kho cov ntawv teeb tsa. Nias Sau kom kho cov ntaub ntawv thiab pom ntu tom ntej rau kev teeb tsa. Ntxiv cov kab hauv qab no rau cov ntaub ntawv teeb tsa, txuag, thiab tawm mus.

lub teeb ==/tsev/pi/ntawv sau/coj…

Kab lus saum toj no txhais tau tias, thaum koj hais lub teeb lossis teeb lub Suab hais kom ua yuav ua rau tsab ntawv/tsev/pi/coj nrog dhau qhov kev sib cav los lossis tawm. Qhov no zoo ib yam li cov txiaj ntsig zoo li thaum koj tau sau tsab ntawv manually.

Siv cov lus txib hauv qab no los pib Lub Suab hais kom ua. -C txhais tau tias yuav tsum ua txuas ntxiv mus, -k pi teeb tsa lub npe tam sim koj yuav hais kom tau txais Raspberry Pi qhov kev mloog. Tus -v ua rau qhov kev zov me nyuam txheeb xyuas qhov ua ntej ua ntej nkag mus rau lub suab paub hom. -I ua rau lub suab hais kom tsuas ua cov lus txib qhia meej hauv cov ntawv teeb tsa. Thaum kawg, -b0 kev sib cav yuam lub suab hais kom tsis txhob siv cov ntawv sau ua ntej nws teb.

voicecommand -c -k pi -v -b0 -i

Ua raws li cov lus txib saum toj no Hais meej PI thiab tos rau cov lus teb "Yog Sir"

Hais meej kom pom kev. LED yuav tsum qhib

Hais kom pom tseeb. LED yuav tsum tua

yog li no …….

Pom zoo: