Cov txheej txheem:

RaspberryPi Islamic Thov Vajtswv Saib & Tswb: 15 Kauj Ruam (nrog Duab)
RaspberryPi Islamic Thov Vajtswv Saib & Tswb: 15 Kauj Ruam (nrog Duab)

Video: RaspberryPi Islamic Thov Vajtswv Saib & Tswb: 15 Kauj Ruam (nrog Duab)

Video: RaspberryPi Islamic Thov Vajtswv Saib & Tswb: 15 Kauj Ruam (nrog Duab)
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Hlis ntuj nqeg
Anonim
RaspberryPi Islamic Thov Vajtswv Saib & Tswb
RaspberryPi Islamic Thov Vajtswv Saib & Tswb
RaspberryPi Islamic Thov Vajtswv Saib & Tswb
RaspberryPi Islamic Thov Vajtswv Saib & Tswb

Cov neeg Muslim thoob ntiaj teb muaj tsib txoj kev thov Vajtswv txhua hnub, thiab txhua qhov kev thov yuav tsum yog nyob rau qee lub sijhawm ntawm hnub ntawd. vim tias txoj kev elliptic peb lub ntiaj teb txav ib puag ncig lub hnub, uas ua rau lub hnub nce thiab poob sij hawm sib txawv nyob rau ib xyoos, uas tseem ua rau lub sijhawm thov Vajtswv tsis tu ncua, uas yog vim li cas peb thiaj xav tau lub moos Islamic ceeb toom rau peb cov Muslim ntawm peb thov Vajtswv txhua lub sijhawm hnub.

Txhua tus neeg Muslim muaj txoj hauv kev nkag mus rau niaj hnub thov Vajtswv huab cua los ntawm Is Taws Nem Islamic lub vev xaib, daim ntawv qhia hnub Islamic hauv lub tebchaws lossis txawm tias los ntawm TV, thiab feem ntau ntawm peb muaj Islamic saib cov cuab yeej uas muaj cov yam ntxwv ntawm muab sijhawm rau peb thov Vajtswv, ntxiv rau thov ceeb toom. Tab sis dab tsi yog tias peb tau ua peb tus kheej Thov Thov Saib thiab Tswb ntaus ntawv!

Ua ntej pib ua haujlwm ntawm txoj haujlwm, muaj qee qhov kev txiav txim siab uas koj yuav muaj txiaj ntsig zoo rau koj thaum nyeem phau ntawv Qhia no. Kuv nyob hauv Saudi Arabia yog li qee qhov ntawm kuv cov kauj ruam thiab qhov txiaj ntsig yuav txawv ntawm koj li, thiab kuv yuav hais meej meej cov ntawd thaum ua haujlwm. Muaj cov kauj ruam thiab cov duab uas yuav suav nrog cov lus Arabic txij li thaum kuv ua kev cuam tshuam hauv Arabic, tab sis kuv kuj yuav taw qhia yuav ua li cas thiaj ua lus Askiv yog li tsis txhob cia cov lus Arabic hauv cov duab ua rau koj txhawj xeeb, qhov haujlwm no tuaj yeem ua tau ua tiav txhua yam Lus (uas txaus!: D) Tsis tas li thov thov zam txim rau kuv li lus Askiv tsis yog kuv thawj hom lus.

Mus rau peb qhov project! Txoj haujlwm no yuav faib ua X Cov kauj ruam tseem ceeb, uas thaum kawg ntawm Xth kauj ruam peb yuav muaj peb txoj haujlwm zoo thiab npaj tau! Cov theem yuav yog raws li hauv qab no:

1-Kho thiab npaj RaspberryPi

2-Txhim Kho RTC Module

3-Ua Azan Alarm program

4-Siv lub ntsej muag saib

5-Ua Tus Neeg Siv Kev Sib Tham thiab

Raws li txhua qhov haujlwm, peb yuav tsum npaj cov ntu peb xav tau ua ntej. ntu uas peb xav tau rau txoj haujlwm no yog:

1-RaspberryPi Cov khoom siv khoos phis tawj Amazon Asmeskas || Amazon KSA

Koj tuaj yeem siv ib qho Rpi version, tsuas yog xyuas kom nws muaj Wifi. Kuv siv Rpi3B+

2-RTC Lub Sijhawm Sijhawm Sijhawm Sijhawm Amazon US || Amazon KSA

Koj tuaj yeem siv ib qho qauv RTC, tsuas yog xyuas kom nws muaj I2C

3-LCD Saib

Txhua lub LCD yuav ua

4-Mouse thiab keyboard

thiab nws yog….. IT !! Qhov ntawd yog txhua yam koj xav tau los ua koj tus kheej lub moos Azan thiab lub tswb

Kauj Ruam 1: Tshooj 1: Teeb tsa thiab teeb tsa RaspberryPI

Tshooj 1: Teeb tsa thiab teeb tsa RaspberryPI
Tshooj 1: Teeb tsa thiab teeb tsa RaspberryPI

Thawj Yam Ua Ntej! Peb yuav tsum npaj Raspberry pi txhawm rau ua haujlwm nrog nws.

Raspberry pi tsis muaj dab tsi tab sis lub computer, nws muaj RAM thiab ROM, nws muaj CPU, GPU, I/O ……. ib yam li ib qho peb ua si game thiab tshawb hauv lub vev xaib nrog, tsuas yog qhov loj uas nws me me! uas ua rau raspberry yog qhov kev xaiv zoo heev rau kev tsim thiab siv cov phiaj xwm ntawm. vim hais tias raspberry pi me me, nws muaj qhov tshwj xeeb tshwj xeeb heev uas nws tsis tuaj yeem ua haujlwm loj xav tau OS zoo li lub qhov rais lossis macOS, hloov pauv, peb yuav siv Linux ua haujlwm ua haujlwm txhawm rau siv lub cuab yeej. muaj ntau txhiab yog tsis yog kaum tawm txhiab Linux kev cuam tshuam uas peb tuaj yeem siv tau, tab sis ib qho zoo tshaj plaws distro tau ua kom zoo tshaj tshwj xeeb rau raspberrypi uas peb yuav siv, hu ua Raspbian.

Kauj Ruam 2: 1-1: Rub Cov Ntaub Ntawv Yuav Tsum Tau

1-1: Rub Cov Ntaub Ntawv Yuav Tsum Tau
1-1: Rub Cov Ntaub Ntawv Yuav Tsum Tau
1-1: Rub Cov Ntaub Ntawv Yuav Tsum Tau
1-1: Rub Cov Ntaub Ntawv Yuav Tsum Tau
1-1: Rub Cov Ntaub Ntawv Yuav Tsum Tau
1-1: Rub Cov Ntaub Ntawv Yuav Tsum Tau

-Xav mus rau nplooj ntawv Rasbian rub tawm ntawm https://www.raspberrypi.org/software/operating-sy… thiab rub tawm Raspberry Pi OS nrog Desktop file

-Thaum nws rub tawm, mus rau https://win32diskimager.org/ thiab rub tawm thiab teeb tsa win32DiskImager, koj tuaj yeem siv cov duab hlawv software uas koj nyiam

ib zaug rub tawm tiav, Koj yuav muaj cov ntaub ntawv.img uas muaj RaspberryPi OS. tom ntej no, ntsaws koj daim npav SD hauv lub computer (feem ntau nrog USB daim npav nyeem ntawv) thiab tso tawm win32diskimager software. cov kauj ruam rau hlawv cov duab rau hauv SD nco yog yooj yim heev, koj tsuas yog xav tau 1- Xaiv koj daim ntawv nco 2-xaiv koj li OS cov ntaub ntawv uas koj rub tawm thiab 3-Nyem sau! Nco ntsoov tias koj tau xaiv tsab ntawv ntaus ntawv raug los ntawm cov npe thiab koj lub cim xeeb tsis muaj dab tsi, xws li los ntawm nias sau koj yuav tau txais kev txhawb nqa nrog ceeb toom uas qhia koj tias txhua yam ntawm lub cuab yeej yuav raug lwv! Nias yog kom paub meej tias sau thiab tos kom nws ua tiav. qhov no yuav siv sijhawm ntev txog 20 feeb.

Thaum nws ua tiav, koj yuav muaj tag nrho Rapbian OS ntawm lub cim xeeb, koj tuaj yeem mus tom ntej thiab muab tso rau hauv Rapberry Pi, txuas Raspberry Pi mus rau tus saib xyuas los ntawm HDMI, txuas tus nas thiab keyboard los ntawm USB thiab kawg, txuas rau hwj chim.

Kauj Ruam 3: 1-2: Kho lub Raspbian System

Tom qab Txuas cov hlua thiab lub zog, koj yuav pom tias OS tau qhib, nws yuav rov pib dua thiab tom qab ntawd nws yuav tso tawm Raspbian User Interface (uas zoo ib yam li windows). thawj qhov koj yuav pom yog lub qhov rai txais tos, uas yuav coj koj mus rau theem ntawm kev teeb tsa koj li RaspberryPi thawj zaug. lub qhov rais thiab cov kauj ruam yuav zoo li no:

1-Nias tom ntej ntawm thawj lub qhov rai "Txais tos"

2-Qhov rai tom ntej yuav yog teeb tsa koj qhov chaw nyob. xaiv koj Lub Tebchaws, hom lus thiab sijhawm sijhawm. tom qab ntawd, nws tau pom zoo kom txheeb xyuas "Siv Lus Askiv" vim tias qhov no yuav yog Cov Txheej Txheem Kev Sib Txuas Lus. Koj YUAV TSUM XAUS "US ENGLISH KEYBOARD LAYOUT BOX" Peb YUAV TSUM MUAJ KEYBOARD ENGLISH ua haujlwm!

3-Tom ntej no, koj yuav raug nug kom nkag mus rau tus password rau koj cov raspberry, qhov no tseem ceeb rau kev nyab xeeb tab sis peb yuav tso nws tsis hloov pauv rau txoj haujlwm no. nco ntsoov tias lub neej ntawd Username thiab password yog:

username: pib

lo lus zais: raspberry

4-Lub qhov rais tom ntej yuav txuas raspberryPi rau koj li WiFi network. xaiv koj lub npe wifi thiab sau koj tus password wifi

5-tom ntej no, koj yuav raug hais kom hloov kho raspberry pi cov tsev qiv ntawv thiab cov ntaub ntawv kaw lus. cov kauj ruam no yuav siv sijhawm ntau (tej zaum yuav teev) tab sis nws yog cov kauj ruam tseem ceeb heev rau txhua lub sijhawm tshiab raspberry pi tab tom teeb tsa.

6-thaum qhov hloov tshiab tau ua tiav, koj yuav raug hais kom rov pib dua lub system. ua tam sim no

Ua haujlwm zoo! Tam sim no peb muaj qhov hloov kho tshiab, peb tseem yuav tsum tau ua qee yam ntxiv los teeb tsa lub kaw lus kom ua haujlwm, tab sis tam sim no, yuav pib siv LinuxCommand Kab.

Kauj Ruam 4: 1-3: Siv Kab Lus Hais Kom Teeb Rpi Chaw

1-3: Siv Kab Lus Hais Kom Teeb Rpi Chaw
1-3: Siv Kab Lus Hais Kom Teeb Rpi Chaw
1-3: Siv Kab Lus Hais Kom Teeb Rpi Chaw
1-3: Siv Kab Lus Hais Kom Teeb Rpi Chaw
1-3: Siv Kab Lus Hais Kom Teeb Rpi Chaw
1-3: Siv Kab Lus Hais Kom Teeb Rpi Chaw

Thaum koj ua tiav rebooting los ntawm kev hloov kho kab ke, lub kaw lus yuav qhia tus neeg siv lub desktop thaum nws tau ua tiav. tam sim no yog tias koj saib mus rau sab saud sab saum toj ntawm lub vijtsam, koj yuav pom qee cov nyees khawm, Ib lub pob nrog raspberryPi Logo uas yog Rpi cov ntawv qhia zaub mov, lub ntiaj teb zoo ib yam uas yog internet browser, lub pob nyem uas yog …. cov ntaub ntawv thiab thaum kawg, khawm nrog lub qhov rai dub screen, uas yog lub pob tseem ceeb tshaj plaws hauv ib qho kab ke linux, Cov kab hais kom ua. mus tom ntej thiab nias lub pob ntawd, koj yuav pom lub qhov rai dub tshwm tuaj.

Cov kab hais kom ua yog yuav ua li cas txhua tus cuam tshuam thiab siv cov kab ke linux, ib yam li lub qhov rais muaj nws kab lus hais kom ua nkaus xwb hauv cov poj ntsuam peb tsis tas yuav siv nws ntau zaus. hauv linux, nws yog qhov yooj yim tshaj plaws txhua tus neeg siv linux yuav tsum kawm thiab txawj. kab hais kom ua tuaj yeem siv los ntawm…. COMMANDS! yam koj pom hauv lub qhov rai dub yog qhov hais kom ua tos tos cov lus txib los ntawm tus neeg siv thiab ua tiav. hauv phau ntawv qhia no peb yuav muab tag nrho cov lus txib uas koj xav tau los ua txoj haujlwm no, yog li tsis txhob txhawj.

thawj Linux hais kom peb yuav siv yog lwm qhov kev hais kom ua, nco ntsoov tias txhua cov lus txib txij tam sim no yuav muab tso rau hauv ib lub thawv ntawv, yog li koj tuaj yeem sib txawv nws los ntawm cov kauj ruam ib txwm muaj. Nqa koj cov keyboard thiab ntaus cov hauv qab no thiab ntaus nkag mus:

sudo raspi-teeb tsa

Yog tias koj ua qhov raug, koj yuav pom tias lub vijtsam tig lub vijtsam tig xiav, nrog lub thawv me grey nyob hauv nruab nrab (saib daim duab). peb yuav siv qhov ntawd los ua peb qhov kev teeb tsa zaum kawg ua ntej peb pib coding.

tam sim no, koj yuav tsum tau siv koj cov keyboard xub tuav mus rau cov ntawv qhia zaub mov no.

1-Mus rau Interface xaiv >> I2C >> YOG >> ntaus nkag. qhov no yog pab kom I2c cov txheej txheem kev sib txuas lus yog li peb tuaj yeem siv RTC

2-Mus rau Advanced xaiv >> Nthuav cov fileystem.

thiab qhov ntawd yog txhua qhov kev teeb tsa uas koj xav tau los ntawm lub qhov rais no. ntawm nplooj ntawv tseem ceeb, nqis mus thiab nias nkag mus rau "ua tiav" thiab "YOG" kom rov pib dua lub system.

Thaum lub kaw lus ua tiav rebooting, peb txhua tus ua tiav kev teeb tsa! lub cuab yeej npaj rau cov kauj ruam loj! Cov kauj ruam tom ntej yuav txhim kho RTC module thiab siv nws nrog cov kab ke.

Kauj Ruam 5: Tshooj 2: Kev teeb tsa, teeb tsa thiab siv RTC Module

Tshooj 2: Mounting, Configuring thiab Siv RTC Module
Tshooj 2: Mounting, Configuring thiab Siv RTC Module
Tshooj 2: Mounting, Configuring thiab Siv RTC Module
Tshooj 2: Mounting, Configuring thiab Siv RTC Module
Tshooj 2: Mounting, Configuring thiab Siv RTC Module
Tshooj 2: Mounting, Configuring thiab Siv RTC Module
Tshooj 2: Mounting, Configuring thiab Siv RTC Module
Tshooj 2: Mounting, Configuring thiab Siv RTC Module

RTC (lossis Lub Sijhawm Sijhawm Sijhawm) tus qauv yog lub cuab yeej me me uas muaj roj teeb me me ntawm nws, nws ua li cas lub npe cuam tshuam rau, Clocking! yog li thaum koj txuas nws rau lub hwj chim lub moos tseem ua haujlwm thiab tsis tso tseg. vim li cas peb thiaj xav tau qhov no? zoo, raspberry pi tiag tiag tsis muaj txoj hauv kev khaws cov ntaub ntawv moos ib zaug nws tau siv hluav taws xob, nws tso siab rau kev txuas rau hauv is taws nem thaum pib kho kom hloov kho nws hnub thiab sijhawm, tab sis qhov teeb meem yog tias peb tsis tas li muaj kev siv internet, thiab qhov no yog vim li cas peb xav tau RTC module. RTC yuav ua lub moos rau raspberry pi yog li thaum Rpi raug thawb nws yuav siv Hnub & Sijhawm los ntawm RTC, uas yuav ua rau RaspberryPi sijhawm hloov tshiab txhua lub sijhawm.

muaj ntau tus qauv thiab saib rau RTC, muaj DS1307 thiab DS3231. koj tuaj yeem siv ib qho RTC tus qauv uas koj pom ntev li nws muaj I2C raws tu qauv kev sib txuas lus (koj tuaj yeem qhia qhov no yog koj tuaj yeem pom SDA thiab SCL pins ntawm tus qauv pins.

zoo li txhua yam hauv phau ntawv qhia no, Kuv siv lwm cov lus qhia kom ua tiav kuv lub hom phiaj hauv txoj haujlwm, cov lus qhia no yuav coj koj thiab qhia koj raws nraim yuav ua dab tsi los ua txoj haujlwm no, tab sis yog tias koj xav tau hloov lossis koj xav tau qhov tob ntxiv rau hauv ib qho ntawm cov kauj ruam, Kuv yuav txuas cov lus qhia muaj txiaj ntsig ntau ntxiv thaum kawg ntawm txhua kauj ruam.

Thaum koj tau txais koj li RTC tus qauv npaj (muab lub taub hau ntsaws thiab tso lub roj teeb rau), koj tuaj yeem txuas nws mus rau RapberryPi pins raws li hauv qab no:

RTC PIN ---------------- Rpi Pin

GND ===========> PIN 6 (GND)

Vcc ============> PIN 1 (3.3V)

SDA ===========> PIN 3 (SDA)

SCL ===========> PIN 5 (SCL)

lossis nyob ntawm seb qhov RTC module koj tau txais, koj tuaj yeem rub nws ncaj qha rau ntawm RaspberryPi (Nco ntsoov tias cov pins raug !

Thaum koj tau txuas nrog RTC, cia teeb tsa Raspberry.

Kauj Ruam 6: 2-1: Teeb Qauv

2-1: Teeb Qauv
2-1: Teeb Qauv
2-1: Teeb Qauv
2-1: Teeb Qauv

Ua ntej pib, mus rau kab hais kom ua thiab ntaus:

hnub tim

Qhov no yuav muab rov qab rau hnub tim thiab sijhawm tam sim no ntawm Raspberry, sau tseg ntawm cov lus txib uas muaj txiaj ntsig zoo, thiab nco ntsoov hnub thiab sijhawm tam sim no yog li peb tuaj yeem tshawb xyuas thaum lub module ua haujlwm lossis tsis ua.

tam sim no, cia peb pib teeb tsa, ntaus cov hauv qab no los hloov kho Rpi cov tsev qiv ntawv, ib kab zuj zus:

sudo apt-tau hloov tshiab

sudo apt -tau -y txhim kho

ib zaug ua tiav, peb yuav tsum hloov kho cov ntaub ntawv system kom pab tau i2c module thiab ntxiv RTC, txhawm rau hloov kho cov ntaub ntawv system peb yuav siv software hu ua Nano. nano yog lub teeb tsa tsim software uas yog qhov pib kho cov ntawv, ib yam li ib tus poj ntsuam. yog li cov lus txib uas pib nrog nano ua raws los ntawm lub npe cov ntaub ntawv, yuav qhib cov ntawv ntawd hauv nano phau ntawv kho kom raug. koj tau pom tias peb kuj tau siv qee yam hu ua Sudo, luv luv, sudo ua zoo li kev lees paub rau lub kaw lus linux uas qhia rau lub kaw lus tias tus neeg siv uas ua cov lus txib ntawd yog tus tswv cuab, tsis yog lwm tus, thiab muab txoj cai zoo li kho/ rho tawm rau tus neeg siv. piv txwv li, yog tias peb qhib cov ntaub ntawv nano tsis muaj sudo, peb yuav tuaj yeem pom cov ntawv ntawd, tab sis peb tsis tuaj yeem kho nws lossis tshem tawm nws.

tam sim no, peb yuav tsum hloov kho cov ntaub ntawv modules, peb tuaj yeem ua qhov no los ntawm kev ntaus:

sudo nano /thiab /modules

thaum koj ua li ntawd, koj yuav pom cov ntsiab lus ntawm cov ntawv ntawd (saib daim duab). siv cov xub xub tso tus cursor rau ntawm qhov kawg ntawm cov ntawv thiab ntxiv cov hauv qab no:

xwb-bcm2835

i2c-bcm2835 i2c-dev rtc-ds1307

nias CTRL+S kom txuag tau, thiab CTRL+X kom tawm mus

Kauj Ruam 7: 2-2: I2C Interface

2-2: I2C Interface
2-2: I2C Interface

Tam sim no peb tau txuas nrog RTC thiab qhib i2c, cia peb txuas txhua yam ua ke.

ntaus cov hauv qab no rau hauv qhov hais kom ua:

i2cdetect -y 1

koj yuav tau txais cov kab lus ntawm qhov khoob, tab sis koj yuav pom tias muaj tus lej nyob qhov twg, tus lej ntawd yog koj li chaw nyob RTC. hauv kuv rooj plaub nws yog 68. nco ntsoov tus lej ntawd. yog tias koj tsis pom tias ob tus lej, qhov ntawd txhais tau tias koj tej zaum txuas nrog RTC tsis raug.

tam sim no, peb yuav tsum hloov kho rc.local cov ntaub ntawv yog li peb tuaj yeem ua haujlwm RTC module ntawm khau raj thiab cia nws txuag hnub thiab sijhawm rau hauv kab ke. ua ntej, qhib rc.local cov ntaub ntawv:

sudo nano /etc/rc.local

Ua ntej txoj kab 0 tawm, ntxiv cov hauv qab no:

ncha ds1307 0x68>/sys/class/i2c-adapter/i2c-1/new_device

hwv -s

qhov twg 0x68 yog koj lub cuab yeej i2c chaw nyob. ib zaug koj ua tiav ntaus CTRL+S CTRL+X, tom qab ntawd rov pib dua koj lub cev los ntawm:

sudo rov pib dua

Kauj Ruam 8: 2-3: Xeem RTC

2-3: Xeem RTC
2-3: Xeem RTC

Thaum lub kaw lus rov pib dua, peb tuaj yeem tshawb xyuas huab cua RTC ua haujlwm lossis tsis yog. ua ntej, khiav:

sudo hwclock -r

koj yuav tau muab rov qab rau hnub thiab sijhawm ntawm RTC module. yog tias koj tau muab lwm yam ntxiv, xyuas kom koj tau ua cov kauj ruam raug.

tam sim no, txhawm rau hloov lub sijhawm thiab hnub tim ntawm RTC, peb yuav tsum hloov kho Hnub & Sijhawm ntawm lub kaw lus ua ntej, tom qab ntawd hloov kho qhov hloov pauv mus rau RTC. ua li ntawd, khiav:

sudo date -s "29 AUG 1997 13:00:00"

thiab ntawm qhov tseeb, hloov hnub thiab sijhawm raws li koj lub sijhawm thiab hnub tim hauv zos, ua ntej koj ntaus nkag. ib zaug koj tau txais lub sijhawm ntawm Rpi txoj cai, khiav cov hauv qab no kom txuag hnub thiab sijhawm ntawm RTC:

sudo hwclock -w

aaaaand yog li ntawd! koj tuaj yeem tshawb xyuas yog tias nws ua haujlwm los ntawm hwclock -r thiab pom tias hnub tim ntawm RTC puas raug lossis tsis yog, tom qab ntawd txuas lub rpi los ntawm Is Taws Nem thiab tom qab ntawd tshem nws tawm rau qee lub sijhawm thiab tom qab ntawd rov ua haujlwm dua thiab pom tias nws muaj qhov raug sijhawm thiab hnub tim. koj nyob nraum ua!

Daim Ntawv Qhia Tag Nrho txog kev teeb tsa RTC module tuaj yeem pom ntawm no

www.raspberrypi-spy.co.uk/2015/05/adding-a-ds3231-real-time-clock-to-the-raspberry-pi/

Kauj Ruam 9: Tshooj 3: Ua Azan Alarm Program

Tshooj 3: Ua Azan Alarm Program
Tshooj 3: Ua Azan Alarm Program

ua lub moos yog ib yam, paub meej, peb tuaj yeem saib lub moos thiab sijhawm thov Vajtswv thiab pom thaum lub sijhawm los txog, tab sis yuav tsis yog txoj kev zoo dua yog tias peb tuaj yeem ntxiv lub tswb nrov ceeb toom rau peb txog lub sijhawm thov Vajtswv? Txawm tias zoo dua, peb ua lub tswb nrov li lub suab ntawm AZAN! cia saib seb peb tuaj yeem ua tiav qhov no li cas.

rau peb cov phiaj xwm, peb yuav siv nab nab raws li peb nyiam cov lus programming vim nab nab mus tau zoo nrog RaspberryPi. los ua tus lej cov ntaub ntawv hauv nab nab, peb ua tib yam li qhib cov ntawv nyeem, tab sis tam sim no peb khaws nws li.py. kom ua qhov haujlwm, peb xav tau ib puag ncig nab hab sej ntawm raspbery, hmoov zoo, Raspbian los nrog nab hab sej 3 ua ntej teeb tsa! yog li txhua yam peb yuav tsum ua yog programming. hauv phau ntawv qhia no, peb yuav tsis tham txog cov lus thiab qhia nws ua haujlwm li cas thiab ua haujlwm li cas, tab sis kuv yuav muab cov lej tsim nyog rau koj kom koj tuaj yeem ua txoj haujlwm.

kom pib, peb xav tau cov ntaub ntawv suab ntawm peb nyiam azan suab (hauv. WAV) peb xav tau ob daim ntawv, ib qho rau al-fajr azan thiab lwm qhov rau azan tsis tu ncua. ib zaug koj tau txais qhov ntawd muab tso rau ntawm tus pas tsav thiab luam nws ntawm lub desktop ntawm raspberrypi.

tam sim no peb muaj cov ntaub ntawv, Kuv tab tom nrhiav txoj hauv kev los ua suab audio ntawm raspberryPi thiab ua rau kuv xav tsis thoob, tsis muaj ntau txoj hauv kev peb tuaj yeem ua qhov no, tab sis kuv pom cov lus teb no ntawm stackoverflow uas muab rau kuv yam kuv xav tau

stackoverflow.com/questions/20021457/playi…

kuv sim txoj kev ntawd thiab nws ua haujlwm! yog li cia saib yuav ua li cas peb tuaj yeem siv txoj hauv kev no hauv peb qhov project …

Kauj Ruam 10: 3-1: Cia Peb Ua Lub Suab

3-1: Cia Ua Si Suab!
3-1: Cia Ua Si Suab!

ua ntej, nkag mus rau desktop los ntawm:

cd Desktop

tom qab ntawd ua cov ntaub ntawv sej sej tshiab los ntawm:

sudo nano AzanPlay.py

qhov no yuav ua cov ntaub ntawv tshiab hu ua AzanPlay nrog kev txuas ntxiv ntawm cov ntaub ntawv nab nab.py, peb yuav muaj lub vijtsam dub dub tso cai rau peb sau peb cov lej. yooj yim sau cov kab no (ceev faj kom tsis txhob hloov ib qho chaw nyob lossis qhov chaw, vim qhov no yog qhov tseem ceeb tshaj plaws hauv nab nab):

los ntawm pygame ntshuam sib tov

mixer.init () mixer.music.load ('/home/pi/Desktop/Adhan-Makkah.wav') mixer.music.play () thaum mixer.music.get_busy () == Muaj tseeb: txuas ntxiv

Qhov twg / Duab / yog qhov uas koj tso koj cov ntaub ntawv suab rau hauv, thiab 'Adhan-Makkah.wav' yog kuv cov ntaub ntawv audio, uas yog Azan suab kaw hauv makkah.

tam sim no los sim peb cov cai, peb khiav nrog nab nab los ntawm kev ntaus ntawv:

nab hab sej AzanPlay.py

thiab koj yuav muaj lub suab ua si los ntawm koj lub HDMI LCD lossis koj lub chaw nres nkoj AUX uas nyob ntawm Raspberrypi. yog tias koj tsis hnov nws los ntawm tus hais lus LCD, ntsaws lub mloog pob ntseg rau hauv AUX thiab tshawb xyuas.

Kauj Ruam 11: 3-2: Tau Sijhawm Thov Vajtswv

3-2: Tau Sijhawm Thov Vajtswv
3-2: Tau Sijhawm Thov Vajtswv

Raws li peb paub, lub sijhawm thov sib txawv los ntawm ib qho chaw hauv ntiaj teb mus rau lwm qhov, thiab txawm tias rau qhov chaw tshwj xeeb, nws txawv ntawm lub xyoo, uas txhais tau tias peb yuav tsum nrhiav txoj hauv kev los khaws peb lub sijhawm thov Vajtswv hauv cov txheej txheem hloov tshiab txhua lub sijhawm, thiab rau qhov ntawd peb xav tau cov haujlwm tshwj xeeb thiab nyuaj heev thiab kev suav kom thiaj ua tau zoo. Hmoov zoo, peb tus kwv tij Hamid Zarrabi-Zadeh tau ua txhua txoj haujlwm peb xav tau rau hauv ib qho haujlwm uas peb tuaj yeem siv tau yooj yim kom tau txais lub sijhawm nyob ntawm peb qhov chaw nyob thiab lub sijhawm tam sim no, AMAZING! koj tuaj yeem nrhiav lub tsev qiv ntawv thiab cov ntaub ntawv los ntawm

praytimes.org/

Yog li, peb yuav siv cov ntaub ntawv txaus no kom tau txais peb lub sijhawm thov thiab siv nws hauv cov kab ke. ua ntej, rub cov lej los ntawm lub vev xaib thiab muab tso rau hauv ib qho / adhan / nplaub tshev, (Peb xav tau ob tus lej JS thiab Python).

tam sim no, cia lub taub hau mus rau phau ntawv ntawd thiab sim lub tsev qiv ntawv, thiab nws tuaj yeem ua dab tsi:

cd awd

nyob ntawd, peb yuav tsum ua cov ntawv xeem tshiab hauv nab nab yog li peb tuaj yeem sim ua haujlwm:

sudo nano testAd.py

sab hauv, sau cov cai no:

ntshuam sijhawm thov Vajtswv

txij hnub tim ntshuam hnub tim tmm = praytimes. PrayTimes (). getTimes (date.today (), [LONGTITUDE, LATITUDE], GMT) luam tawm (tmm)

Ua ntej khaws cov ntaub ntawv, koj yuav tsum hloov LATITUDE nrog koj qhov chaw Latitude, ib yam nrog LONGTITUDE, thiab hloov GMT rau koj lub sijhawm. hauv kuv qhov teeb meem, nws yuav yog:

tmm = praytimes. PrayTimes (). getTimes (date.today (), [21.3236, 39.1022], 3)

luam tawm (tmm)

Thaum kawg, CTRL-S thiab CTRL-X thiab tom qab ntawd sau cov cai:

python testAd.py

thaum kawg, koj yuav tau rov qab thov koj lub sijhawm rau hnub no, rau koj qhov chaw nyob.

{'isha': '18: 58 ',' asr ': '15: 22', 'hnub poob': '17: 43 ',' dhuhr ': '12: 17', 'maghrib': '17: 43 ', 'imsak': '05: 23 ',' ib tag hmo ': '00: 17', 'hnub tuaj': '06: 52 ',' fajr ': '05: 33'}

Zoo kawg! tam sim no uas peb tau txais peb lub sijhawm thov Vajtswv thiab tam sim no peb paub yuav ua suab li cas, cia peb ua ke ob lub lis piam ua ke rau hauv ib lub ntsiab cai.

Kauj Ruam 12: 3-3: Ua Zaum Kawg Azan Tswb Code

los ntawm kev ua tiav ob txoj cai yav dhau los, peb tau kawm paub yuav ua li cas thiaj tau thov lub sijhawm raws li peb qhov chaw nyob thiab yuav ua li cas thiaj ua tau suab Azan. tam sim no, peb yuav sib sau ua ke ob txoj cai no rau hauv ib txoj cai uas peb yuav siv los ua peb txoj haujlwm kawg, thiab cov cai no yuav ua haujlwm yav tom ntej, zoo li thaum lub sijhawm Azan los txog, nws yuav ua suab Azan.

Kuv tau sau tag nrho cov cai, koj tuaj yeem luam nws thiab muab tshuaj txhuam, thiab hloov pauv koj tus kheej raws li koj pom zoo. Cov cai yog:

lub sij hawm ntshuam

los ntawm pygame ntshuam sib xyaw ntshuam hlua ntshuam sijhawm thov los ntawm hnub tim ntshuam hnub tim thaum (1): tmm = praytimes. PrayTimes (). getTimes (date.today (), [21.3236, 39.1022], 3) FAJR = tmm ['fajr'] DHUHR = tmm ['dhuhr'] ASR = tmm ['asr'] MAGHRIB = tmm ['maghrib'] ISHA = tmm ['isha'] tempT = time.strftime (str ('%H')) currTime = tempT tempT = time.strftime (str ('%M')) currTime = currTime + ':' + tempT yog currTime == FAJR: mixer.init () mixer.music.load ('/home/pi/Desktop/Adhan-fajr. wav ') mixer.music.play () thaum mixer.music.get_busy () == Muaj tseeb: txuas ntxiv yog tias currTime == DHUHR: mixer.init () mixer.music.load ('/home/pi/Desktop/Adhan- Makkah.wav ') mixer.music.play () thaum mixer.music.get_busy () == Muaj tseeb: txuas ntxiv yog tias currTime == ASR: mixer.init () mixer.music.load ('/home/pi/Desktop/ Adhan-Makkah.wav ') mixer.music.play () thaum mixer.music.get_busy () == Muaj tseeb: txuas ntxiv yog tias currTime == MAGHRIB: mixer.init () mixer.music.load ('/home/pi/ Desktop/Adhan-Makkah.wav ') mixer.music.play () thaum mixer.music.get_busy () == Muaj tseeb: txuas ntxiv yog currTime == ISHA: mixer.init () mixer.music.load ('/home/pi/Desktop/Adhan-Makkah.wav') mixer.music.play () thaum mixer.music.get_busy () == Muaj tseeb: txuas ntxiv mus

Yog tias koj saib cov cai thiab sib piv nws rau yam peb tau ua yav dhau los, koj yuav pom tias peb tsis tau ua dab tsi ntau ntxiv, thaum xub thawj, peb suav nrog peb cov tsev qiv ntawv xav tau thiab tom qab ntawd peb qhib lub voj voos tsis kawg. hauv lub voj, peb niaj hnub suav nrog lub sijhawm thov nrog peb qhov chaw nyob thiab thaj tsam sijhawm, thiab khaws tag nrho cov txiaj ntsig hauv tmm sib txawv. tom qab ntawd, peb khaws txhua lub sijhawm thov los ntawm tmm mus rau qhov sib txawv ywj pheej. uas yuav tso cai rau peb los sib piv lub sijhawm. tom ntej no, peb siv sijhawm lub sijhawm thiab khaws nws hauv qhov sib txawv ntawm kev ywj pheej. Thaum kawg, peb khaws qhov sib piv lub sijhawm nrog lub sijhawm thov Vajtswv, yog lub sijhawm ua haujlwm zoo ib yam ntawm lub sijhawm thov Vajtswv, nws yuav ua suab Azan.

Kauj Ruam 13: Tshooj 4: Siv Lub Ntsej Muag Saib

Tshooj 4: Ua Kom Pom Lub ntsej muag
Tshooj 4: Ua Kom Pom Lub ntsej muag
Tshooj Lus 4: Siv Tus Saib Xyuas Lub ntsej muag
Tshooj Lus 4: Siv Tus Saib Xyuas Lub ntsej muag
Tshooj Lus 4: Siv Tus Saib Xyuas Lub ntsej muag
Tshooj Lus 4: Siv Tus Saib Xyuas Lub ntsej muag
Tshooj Lus 4: Siv Tus Saib Xyuas Lub ntsej muag
Tshooj Lus 4: Siv Tus Saib Xyuas Lub ntsej muag

Txhawm rau ua kom txoj haujlwm zoo dua, Kuv muaj lub tswv yim ntxiv saib lub ntsej muag rau lub LCD, yog li nws zoo li saib zoo rau tus neeg siv (zoo, zoo dua li kab hais kom ua tsawg kawg) yog li, kuv tau ntiav tus tsim qauv los tsim ntau lub ntsej muag rau lub moos, nws yuav tsum khoob yam tsis muaj cov ntaub ntawv, raws li cov ntaub ntawv yuav tsum tau ntxiv los ntawm HTML, ua lub moos tsim raws li keeb kwm yav dhau, thiab lwm cov ntaub ntawv xws li lub sijhawm thov tuaj yeem muab ntxiv ua cov ntsiab lus HTML nyob rau saum toj ntawm keeb kwm yav dhau.

Hmoov tsis zoo, raws li lub sijhawm sau cov lus qhia no muaj peev xwm, kuv qhov kev paub thiab kev paub hauv HTML yog qhov txwv heev yog li kuv yuav tsis tham txog cov ncauj lus ntau ntxiv vim tias kuv paub qhov tseeb tias kuv yuav ua yam tsis raug, thiab kuv tsis ua xav kom neeg tsis meej pem. tab sis yog tias koj muaj kev paub me ntsis hauv JS thiab HTML koj yuav tsum paub yuav ua li cas txuas ntxiv los ntawm qhov no. txog tam sim no kuv tau ua ib lub ntsej muag (ib qho xiav). lub hom phiaj yog ua kom 14 lub ntsej muag saib! 7 ntsej muag rau niaj hnub ntawm lub lim tiam, thiab lwm 7 yog lwm lub ntsiab lus. raws li thawj lub ntsiab lus yuav tsum yog nrog Azkar dov, thiab lwm lub ntsiab lus xav tias yuav tsum muaj Islamic GIFS hloov ntawm Azkar. Txawm li cas los xij, kuv yuav suav tag nrho cov qauv tsim hauv cov lus qhia no yog li koj tuaj yeem rub tawm nws.

Kauj Ruam 14: Tshooj 5: Siv Tus Neeg Siv Kev Sib Tham

Tshooj 5: Siv Tus Neeg Siv Kev Sib Tham
Tshooj 5: Siv Tus Neeg Siv Kev Sib Tham

Hauv tshooj kawg ntawm peb txoj kev taug, peb yuav hloov qee qhov kev xaiv los ua qhov haujlwm txawm tias tus neeg siv yooj yim, yog tias peb xav ua qhov haujlwm hauv lub tsev teev ntuj lossis ib qho chaw pej xeem. raws li peb tau hais ua ntej, txhua lub nroog muaj nws tus kheej lub sijhawm rau kev thov Vajtswv, thiab txhawm rau ua txoj haujlwm no kom tau txais txiaj ntsig ntawm tib neeg ntau dua, peb yuav ua tus neeg siv cuam tshuam yog li peb tuaj yeem xaiv peb lub nroog xav tau thiab lub ntsiab lus thaum peb muaj zog ntawm txoj haujlwm.

Txhawm rau ua qhov no, peb yuav siv lub tsev qiv ntawv nab nab GUI hu ua "TKinter".

Nov yog txoj cai uas kuv tau siv los muab rau kuv xaiv los xaiv ntawm tsib lub nroog hauv Saudi Arabia, suav nrog Makkah:

ntshuam tkinter li tk

los ntawm tkinter ntshuam * los ntawm tkinter ntshuam ttk ntshuam codecs ntshuam os chav kawm karl (Ncej): def _init _ (tus kheej): tk. Frame._ init _ (self) self.pack () self.master.title ("Azan Time") nws tus kheej. button1 = Khawm (tus kheej, ntawv = "Jeddah", qhov siab = 5, dav = 80, hais kom = self.open_jeddah1) self.button2 = Khawm (tus kheej, ntawv = "Makkah", qhov siab = 5, dav = 80, hais kom ua = self.open_makkah1) self.button3 = Khawm (tus kheej, ntawv = "Riyadh", qhov siab = 5, dav = 80, hais kom = self.open_riyadh1) self.button4 = Khawm (tus kheej, ntawv = "Madina", qhov siab = 5, dav = 80, hais kom = self.open_madina1) self.button5 = Khawm (tus kheej, ntawv = "Qasim", qhov siab = 5, dav = 80, hais kom = self.open_qasaim1) self.button1.grid (kab = 0, kab lus = 1, columnspan = 2, nplaum = W+E+N+S) self.button2.grid (kab = 1, kab ntawv = 1, kab ntawv kab lus = 2, nplaum = W+E+N+S) self.button3.grid (row = 2, column = 1, columnpan = 2, nplaum = W+E+N+S) self.button4.grid (kab = 3, kab ntawv = 1, kab ntawv = 2, nplaum = W+E+N+S) self.button5.grid (kab = 4, kab ntawv = 1, kab ntawv = 2, nplaum = W+E+N+S) def open_jeddah1 (tus kheej): xaj = "sudo chromium-browser /home/pi/Desktop/Cities/jeddah/Sunday1.html-pib-puv npo-tsis-sandbox" os.system (xaj) def open_makkah1 (tus kheej): xaj = "sudo chromium-browser /home/pi/Desktop/Cities/makkah/Sunday1.html-pib-puv npo-tsis-sandbox -test-type" os.system (xaj) def open_riyadh1 (tus kheej): xaj = "sudo chromium-browser /home/pi/Desktop/Cities/riyadh/Sunday1.html-pib-fullscreen-tsis-sandbox -test-type" os.system (xaj) def open_madina1 (tus kheej): xaj = "sudo chromium-browser /home/pi/Desktop/Cities/madina/Sunday1.html-pib-puv npo-tsis-sandbox -test-type" os.system (xaj) def open_qasaim1 (tus kheej): xaj = "sudo chromium-browser /home/pi/Desktop/Cities/qasaim/Sunday1.html-pib-puv npo-tsis-sandbox -test-type" os.system (xaj) def main (): karl (). mainloop () yog _name_ == '_main_': main ()

Cov cai yuav zoo li loj, tab sis kho nws yooj yim heev. peb pib ua lub qhov rai tshiab, muab tsib lub npe khawm thiab txhais tsib lub funcions kom raug hu raws li txhua lub pob nyem. ib zaug koj nias lub pob, txoj haujlwm yuav qhib cov ntawv HTML sib xws hauv Cities folder, uas txhua lub nroog HTML muaj lub nroog tswj hwm thaum nws tau txais lub sijhawm los ntawm kev thov Vajtswv (). ib zaug koj nias lub pob, tus nab npawb nab npawb yuav ua tus lej linux uas nws yuav qhib cov ntawv HTML siv lub tshuab chromium, thiab koj yuav muaj lub ntsej muag saib npaj los tso tawm, nrog rau kev xaiv puv npo.

Kauj Ruam 15: (Tsis teb los tau): Ntxiv Tus Hais Lus Hloov

(Tsis teb los tau): Ntxiv Tus Hais Lus Hloov
(Tsis teb los tau): Ntxiv Tus Hais Lus Hloov
(Tsis teb los tau): Ntxiv Tus Hais Lus Hloov
(Tsis teb los tau): Ntxiv Tus Hais Lus Hloov

Raws li peb tau pom, thaum lub sijhawm thov Vajtswv los Azan suab ua si, thiab lub suab tawm los ntawm lub suab tso tawm tsis raug (HDMI lossis AV tso tawm) thiab txij li peb tau tso nws ntawm HDMI cov zis, lub suab yuav los ntawm LCD. tab sis, ua li cas yog tias peb lub suab LCD tsis txaus? Piv txwv li, yuav ua li cas yog tias peb xav siv qhov no sab hauv lub tsev teev ntuj tiag? nrog cov neeg hais lus sab nraud? tom qab ntawd peb tuaj yeem ntxiv ib kauj ruam yooj yim heev kom ua tiav qhov ntawd. rau qhov twb tau tsim lub tshuab hais lus lub suab, peb tsuas yog yuav tsum tig nws ON thiab OFF, thiab siv lub microphone uas twb muaj lawm thiab muab tso rau ib sab ntawm tus hais lus LCD.

Ua li ntawd yog ib qho yooj yim. peb yuav siv lub xov tooj cua mosque uas twb muaj lawm uas txuas nrog lub suab nrov nrov, peb tsuas yog xav tau raspberryPi los tswj lub zog uas hloov tag nrho lub suab kaw lus ON thiab OFF. kom ua tau li ntawd, peb yuav tsum tau siv SSR: SOLID STATE RELAY. cov hom kev xa tawm no tuaj yeem ua haujlwm hloov pauv, zoo ib yam li qhov nruab nrab xiav txuas, qhov sib txawv yog SSRs tuaj yeem tiv taus ntau qhov AC Amperage los ntawm nws, uas tsis siv rau hauv cov xiav (feem ntau yog 10A), thiab SSRs xav tau tsuas yog ob lub xov hlau hloov ntawm 3: DC+ thiab DC- thiab qhov ntawd yog nws! nyob rau lwm qhov kawg ntawm SSR peb tuaj yeem txuas tus hais lus system fais fab cable, txoj kev ntawd, thaum peb muab qhov hluav taws xob rau SSR, nws yuav kaw AC Circuit ntawm tus hais lus, lossis peb kaw qhov hluav taws xob kom qhib hluav taws xob, tua cov hais lus.

muaj ib qho pov tseg, RaspberryPi pins tso tawm 3.3v, tsis yog 5v uas peb xav tau los tswj hwm SSR. yog li peb xav tau transistor coj lub teeb liab los ntawm RPi tus pin, thiab 5V los ntawm RPi 5v tus pin. ua li peb xav tau:

1-Solid State Relay (txhua yam saum 25A yog qhov zoo)

2-2n2222 npn transistor

3-220ohm resistor

ua raws qhov kev sib tw fritzing rau kev sib txuas.

tam sim no hauv txoj cai, peb yuav ntxiv qee yam khoom uas ua rau txoj haujlwm no. ua ntej, ua ntej lub sijhawm voj, peb yuav ntxiv qee kab los pib ua GPIO pins:

Hauv ntu ntshuam, ntxiv:

ntshuam RPi. GPIO ua GPIO

Ua ntej lub sijhawm voj, ntxiv:

GPIO.setmode (GPIO. BOARD) GPIO.setwarnings (Cuav) relay = 40 GPIO.setup (ledPin, GPIO. OUT)

Tam sim no, nyob rau lub sijhawm luv, rau txhua qhov kev ua si Azan hais kom ua, peb yuav tsum qhib lub relay, tos txog 10 vib nas this, ua tiav qhov ua si Azan thiab tom qab ntawd tua lub relay. peb tsuas yog xav tau ntxiv ob kab, thawj qhov yog:

GPIO.output (ledPin, GPIO. HIGH)

sijhawm.sleep (10)

qhov no yuav tsum tau ntxiv tom qab txhua qhov yog hais tawm (IDENTATION YOG TSEEM CEEB!), Lwm kab yog:

GPIO.output (ledPin, GPIO. LOW)

Qhov no yuav tsum tau ntxiv tom qab kab "txuas ntxiv". nws yuav tsum zoo li qhov no rau txhua lub sijhawm Azan:

yog currTime == FAJR:

GPIO.output (ledPin, GPIO. HIGH) time.sleep (10) mixer.init () mixer.music.load ('/home/pi/Desktop/Adhan-fajr.wav') mixer.music.play () thaum mixer.music.get_busy () == Muaj tseeb: txuas ntxiv GPIO.output (ledPin, GPIO. LOW)

Pom zoo: