Cov txheej txheem:

Thawj Tswj Hwm Lub Sijhawm Suav Rov Qab Los (Wifi): 6 Kauj Ruam
Thawj Tswj Hwm Lub Sijhawm Suav Rov Qab Los (Wifi): 6 Kauj Ruam

Video: Thawj Tswj Hwm Lub Sijhawm Suav Rov Qab Los (Wifi): 6 Kauj Ruam

Video: Thawj Tswj Hwm Lub Sijhawm Suav Rov Qab Los (Wifi): 6 Kauj Ruam
Video: Tswv Yexus lub neej thaum pib txug thaum xaus 2024, Kaum ib hlis
Anonim
Thawj Tswj Hwm Lub Rooj Sab Laj Countdown (Wifi)
Thawj Tswj Hwm Lub Rooj Sab Laj Countdown (Wifi)
Thawj Tswj Hwm Lub Rooj Sab Laj Countdown (Wifi)
Thawj Tswj Hwm Lub Rooj Sab Laj Countdown (Wifi)
Thawj Tswj Hwm Lub Rooj Sab Laj Countdown (Wifi)
Thawj Tswj Hwm Lub Rooj Sab Laj Countdown (Wifi)

Txheej txheem cej luam: Countdown moos zoo ib yam li cov khoom lag luam, nrog ob peb twists:

a) Thaum lub sijhawm ua tiav lub hom phiaj, lub moos suav rov qab: nthuav tawm cov lus tshaj tawm, thiab ua suab nrov thiab nkauj mp3 - qhov xwm txheej no, R. E. M. nkauj: "Nws Yog Qhov Kawg Ntawm Lub Ntiaj Teb Raws Li Peb Paub Nws (Thiab Kuv Zoo Li Cas)." Ua si hauv Youtube

b) Koj tuaj yeem hais qhia lub sijhawm tseeb ntawm qhov xwm txheej yav tom ntej mus rau feeb thiab thib ob.

c) Wifi moos muaj nuj nqi tshem tawm lub sijhawm drift, thiab tso cai yooj yim dua-huab cua rov ua dua tshiab rau cov xwm txheej yav tom ntej.

Cheebtsam tseem ceeb: Raspberry Pi, 16 x 2 LCD, thiab lub zog hais lus tau teeb tsa hauv khw muag khoom duas 5x7 daim duab thav duab.

Kev Txawj Ntse Qib: Paub txog teeb tsa Raspberry Pi thiab khiav tsis tau taub hau, Linux cov lus txib yooj yim thiab cov kev pab cuam nab nab, thiab me ntsis ntawm cov laug (3 xov hlau).

Kauj Ruam 1: Qhov Chaw thiab Cov Cuab Yeej

Qhov Chaw thiab Cov Cuab Yeej
Qhov Chaw thiab Cov Cuab Yeej
Qhov Chaw thiab Cov Cuab Yeej
Qhov Chaw thiab Cov Cuab Yeej
Qhov Chaw thiab Cov Cuab Yeej
Qhov Chaw thiab Cov Cuab Yeej

Qhov:

  1. Raspberry Pi qauv B+ lossis tom qab thiab rooj plaub
  2. USB powered speaker nrog 3.5 mm audio input. Tus hais lus kuv siv yog khoom pub dawb, tab sis tus neeg hais lus no zoo li ze … hais lus. Qhov zoo tshaj plaws ib yam nrog rau daim foos xwm txheej.
  3. 2 micro USB cables thiab ob lub chaw nres nkoj them nyiaj - xaiv tau xim liab khawm xaim hlua
  4. 5x7 daim duab duab
  5. Sparkfun Audio Cable TRRS - 18 "(pigtail) CAB -11580
  6. Digikey CP-3502-ND 3.5 hli lub tso suab ntsaws
  7. 3/4 "tuab hardboard lossis plywood txog 5" los ntawm 8"
  8. I2C 2X16 LCD zaub module
  9. 4 poj niam rau poj niam dupont jumper xov hlau (100 lossis 200 mm ntev yog qhov zoo)
  10. USB wifi adapter

Cov Cuab Yeej:

  1. Kub kua nplaum phom
  2. Soldering hlau
  3. Hlau hlua
  4. Band los yog jig pom

Kauj Ruam 2: Tsim TRRS Audio Cable

Ua TRRS Audio Cable
Ua TRRS Audio Cable

Muab cov xim daj, liab, thiab ntsuab coj los ntawm Sparkfun Audio Cable TRRS-18 (pigtail) CAB-11580 rau Digikey CP-3502-ND 3.5 mm lub tso suab ntsaws li qhia hauv daim duab

Kauj Ruam 3: Teeb Raspberry PI

a) Teeb Raspberry Pi, nco ntsoov qhib I2C thiab SHH, tseem teeb tsa wifi thiab nco ntsoov koj tuaj yeem txuas rau raspberry pi hauv "hom tsis muaj hau". Phau ntawv qhia.

b) Tsim qhov project subdirectory - Kuv hu kuv li "trump" los muab cov ntaub ntawv xav tau rau hauv.

mkdir tug

cd trwb

pwd hais kom ua yuav tsum tawm los/tsev/pi/trump

c) Luam koj cov suab thiab cov nkauj nkauj rau hauv/tsev/pi/trump. Cov ntaub ntawv npe yuav tsum yog DRUMROLL.wav thiab zaj nkauj remsong.mp3 los ua haujlwm nrog as-is python program peb yuav ntxiv tom qab. Koj tuaj yeem siv cov npe cov ntaub ntawv sib txawv, tab sis tom qab ntawd koj yuav tsum tau kho cov ntaub ntawv nab. Kuv tsis tuaj yeem muab cov ntaub ntawv no rau kev cai lij choj - tab sis koj tuaj yeem pom ntau lub suab cuam tshuam cov ntaub ntawv suav nrog hauv Windows OS, thiab tau kawg rub cov nkauj los ntawm iTunes, Amazon …

Hint - rau kev txav cov ntaub ntawv rov qab los ntawm kuv lub PC thiab RasPi, Kuv siv cov haujlwm pabcuam winSCP

Kauj Ruam 4: Txuas LCD Zaub rau Raspberry Pi, Teeb thiab Kuaj

Txuas LCD Zaub rau Raspberry Pi, Teeb thiab Kuaj
Txuas LCD Zaub rau Raspberry Pi, Teeb thiab Kuaj

a) Txuas lub LCD rau Raspberry PI siv 4 tus poj niam rau poj niam jumper. Txuas tus SDA tus pin ntawm RasPi mus rau GPIO SDA tus pin ntawm LCD, thiab SCL tus pin ntawm RasPi mus rau SCL tus pin ntawm LCD, tseem txuas rau 5 volt thiab hauv av pins los ntawm RasPi rau LCD.

b) Kom tau txais koj li RasPi tham nrog LCD - nkag mus rau Raspberry Pi hauv lub taub hau hom, thiab saib phau ntawv qhia PROGRAMMING THE LCD NROG PYTHON los ntawm Circuit Basics. Koj yuav tsum ua kom tiav yam tsawg ntu ntu hu ua: INSTALLING THE RPLCD LIBRARY and WRITE TO DISPLAY IN 8 BIT MODE. Xyuas kom koj tuaj yeem tso saib "Nyob Zoo Ntiaj Teb" ntawm LCD. Tsis txhob mus ntxiv ntxiv kom txog thaum qhov no ua tiav.

Kauj Ruam 5: Kev Xeem System

Kev Xeem
Kev Xeem

a) Khaws lub LCD txuas nrog, tseem txuas TRRS audio cable ntawm tus hais lus thiab RasPi (TRRS cable kawg rau RasPi). Txuas ob qho RasPi thiab tus hais lus rau lub zog. Saib daim duab saum toj no.

b) Luam cov ntawv cntDwnSng.py rau hauv koj phau ntawv teev npe. Txog kev ntsuas lub hom phiaj, hloov kho cov ntaub ntawv txhawm rau hloov pauv hnub tim rau qee zaum txog 10 feeb tawm los ntawm txhua lub sijhawm koj tab tom sim qhov kev xeem:

Cov ntsiab lus hais kom ua -

hloov mus rau trump directory"

cd trwb

kho nrog:

nano cntDwnSng.py

hloov sej program hnub tim qhov tseem ceeb:

# nkag lub sijhawm thiab hnub tim ntawm hnub no = 20

hli = 1

xyoo = 2017

teev = 12

feeb = 00

nqi = 0

c) txuag cov program nab hab sej thiab hais kom ua:

nab hab sej cntDwnSng.py

d) Qhov kev cia siab tshwm sim yog: LCD suav lub sijhawm kom txog thaum nws mus txog xoom lub sijhawm, tom qab ntawd lub suab nrov ua si, tom qab ntawd cov lus LCD nthuav tawm, thiab thaum kawg zaj nkauj mp3 ua si. Yog tias txhua yam mus zoo koj tuaj yeem rov pib hnub tim qhov tseem ceeb.

Kauj Ruam 6: Hloov Kho Duab Duab thiab Rooj Sib Tham Kawg

Hloov Kho Duab Duab thiab Rooj Sib Tham Kawg
Hloov Kho Duab Duab thiab Rooj Sib Tham Kawg
Hloov Kho Duab Duab thiab Rooj Sib Tham Kawg
Hloov Kho Duab Duab thiab Rooj Sib Tham Kawg
Hloov Kho Duab Duab thiab Rooj Sib Tham Kawg
Hloov Kho Duab Duab thiab Rooj Sib Tham Kawg

a) Qhib cov duab thav duab thav duab txhawb nqa caj npab sab-rau-sab kom tshem tawm ntawm nraub qaum.

b) Luam tawm Cov Ntaub Ntawv Qhib Chaw (yog-j.webp

c) Txiav tag nrho cov pins uas nyob ze rau ntawm lub vijtsam kom tau txais qhov yaug ntau dua. Txuas LCD mus rau thav duab nraub qaum nrog cov kua nplaum kub thiab daim kab xev daim kab xev. Tsis txhob teeb lub LCD upside down!

d) Nrog ib pab pawg lossis jig pom, txiav tawm cov thav duab txhawb nqa ib daim duab thiab txuas rau daim duab thav duab sab nraub qaum nrog cov kua nplaum kub - saib xyuas kom ntseeg tau tias nws tau txuas ua ke.

e) Ntxig rau 4 dupont xov hlau mus rau RasPi GPIO tus pin ua ntej snapping RasPi rooj plaub ua ke.

f) Txuas Raspi thiab tus hais lus los thav duab txhawb nqa caj npab nrog kua nplaum kub. Ua kom tiav lwm qhov txuas ib kauj ruam dhau los. Yeem tau - khi lub USB fais fab cable ua ke nrog cov hlua liab xaim hlua.

g) Txhawm rau pib-khiav txoj haujlwm nab hab sej ntawm kev pib nkag mus hais kom ua:

sudo nano /thiab /profile

Scroll rau hauv qab thiab ntxiv kab hauv qab no:

sudo python /home/pi/trump/cntDwnSng.py

Ntaus Ctrl-X kom tawm mus, tom qab ntawd "Y" kom txuag raws li "Nkag mus" ob zaug.

h) Mus ntxiv - tam sim no koj muaj RasPi tswj lub peev xwm, koj tuaj yeem yooj yim ntxiv txawm tias muaj kev ua koob tsheej ntau ntxiv, saib Xyoo Tshiab Lub Sij Hawm Countdown Timer Nrog Lub foob pob hluav taws tso tawm lub peev xwm

Pom zoo: