Cov txheej txheem:

Yuav Tswj Tus Ntaus Li Cas Siv Raspberry Pi thiab Relay - HAUJ LWM: 6 Kauj Ruam
Yuav Tswj Tus Ntaus Li Cas Siv Raspberry Pi thiab Relay - HAUJ LWM: 6 Kauj Ruam

Video: Yuav Tswj Tus Ntaus Li Cas Siv Raspberry Pi thiab Relay - HAUJ LWM: 6 Kauj Ruam

Video: Yuav Tswj Tus Ntaus Li Cas Siv Raspberry Pi thiab Relay - HAUJ LWM: 6 Kauj Ruam
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Hlis ntuj nqeg
Anonim
Yuav Tswj Tus Ntaus Li Cas Siv Raspberry Pi thiab Kev Tshaj Tawm - QHOV TSEEB
Yuav Tswj Tus Ntaus Li Cas Siv Raspberry Pi thiab Kev Tshaj Tawm - QHOV TSEEB

Nov yog cov lus qhia yooj yim thiab ncaj nraim rau kev tswj hwm lub cuab yeej siv Raspberry Pi thiab Kev Tshaj Tawm, pab tau rau kev ua IoT Cov Haujlwm

Phau ntawv qhia no yog rau cov pib tshiab, nws yog tus phooj ywg ua raws nrog txawm tias koj tsis muaj kev paub txog kev siv Raspberry Pi thiab nws suav nrog yuav teeb tsa koj li raspberry pi li cas

Khoom siv

Raspberry Pi - Kuv siv tus qauv 4B

Micro SD daim npav, nrog Micro SD daim npav nyeem ntawv

Screen lossis TV, Keyboard, thiab Mouse

Relay - Kuv tau txais kuv los ntawm

Txhua yam khoom siv

Kauj ruam 1: Format Your Micro SD Card

Format Koj Micro SD Card
Format Koj Micro SD Card

Txuas koj daim npav Micro SD rau daim npav nyeem ntawv, tom qab ntawd ntsaws nws rau koj mac Mus rau Disk Utility thiab nrhiav koj daim npav SD Nyem rau Lwv

npe nws thiab xaiv MS-DOS (FAT) rau nws hom ntawv, tom qab ntawd nyem Lwv

Qhov thib ob: Rub tawm NOOBS

Mus rau https://www.raspberrypi.org/downloads/noobs/ thiab rub tawm NOOBS ZIP file, (TSIS TXHOB DOWNLOAD LITE VERSION)

Unzip cov ntawv, luam thiab muab tso rau hauv koj daim npav Micro SD

Thib peb: Txhim kho koj lub Micro SD rau koj li Raspberry Pi Tom qab ntawd ntsaws koj tus nas thiab keyboard rau ntawm USB chaw nres nkoj

Kauj ruam 2: Txuas Koj Raspberry Pi

Txuas koj Raspberry Pi
Txuas koj Raspberry Pi
Txuas koj Raspberry Pi
Txuas koj Raspberry Pi

Ntxig rau Micro SD daim npav hauv qab Raspberry Pi ntawm sab laug

Txuas koj nas thiab keyboard rau USB chaw nres nkoj

Txuas koj lub vijtsam rau USB chaw nres nkoj thiab Micro USB chaw nres nkoj

Txuas lub xov tooj hluav taws xob mus rau USB-C chaw nres nkoj thiab txuas nws mus rau lub zog hluav taws xob

(saib cov duab txuas nrog)

Kauj Ruam 3: Pib Pib Koj Raspberry Pi

Pib Pib Koj Raspberry Pi
Pib Pib Koj Raspberry Pi

Txuas koj li Raspberry Pi mus rau lub qhov hluav taws xob thiab nws yuav tsum qhib kom raug

Ib lub qhov rai yuav tshwm rau nruab NOOBS, nyem rau ntawm Raspbian Full [Pom Zoo], tom qab ntawd nyem nruab

ua tiav teeb tsa koj li Raspberry Pi, nws yuav siv ob peb feeb

Kauj Ruam 4: Txuas Txuas Txuas rau Raspberry Pi

Txuas Relay rau Raspberry Pi
Txuas Relay rau Raspberry Pi
Txuas Relay rau Raspberry Pi
Txuas Relay rau Raspberry Pi

Kaw koj lub Raspberry Pi thiab tshem nws

Plugin lub relay

Plug Raspberry Pi rau [ib txwm ON] qhov hluav taws xob hauv qhov txuas

Plugin koj lub cuab yeej xav tau rau ib qho ntawm [ib txwm OFF] qhov hluav taws xob

Kauj Ruam 5: Txuas Jumper Wires

Txuas Jumper Wires
Txuas Jumper Wires
Txuas Jumper Wires
Txuas Jumper Wires
Txuas Jumper Wires
Txuas Jumper Wires
Txuas Jumper Wires
Txuas Jumper Wires

Tshem tawm qhov txuas txuas tawm ntawm qhov txuas

Ntsia hlau-hauv jumper xov hlau

Rov qab cov tswv yim txuas mus rau nws qhov chaw

Txuas qhov txuas hluav taws xob zoo rau GPIO 17 tus pin

Txuas qhov tsis zoo jumper hlau rau hauv av pin (saib mus rau daim duab GPIO)

Kauj Ruam 6:

Duab
Duab
Duab
Duab

Qhib Raspberry Pi

Mus rau Raspbian> Programing> Thonny Python IDE

Ntaus koj tus lej, koj tuaj yeem siv qhov hauv qab no:

ntshuam RPi. GPIO ua GPIO

ntshuam sij hawm GPIO.setmode (GPIO. BCM) PWR = 17 GPIO.setwarnings (Tsis tseeb) GPIO.setup (PWR, GPIO. OUT) GPIO.output (PWR, Muaj tseeb) time.sleep (5) GPIO.output (PWR, Tsis tseeb)) GPIO.cleanup ()

Ntaus [Khiav]

Koj lub cuab yeej yuav tsum qhib rau 5 vib nas this

Nco tseg: koj tuaj yeem hloov sijhawm los ntawm kev hloov tus lej 5 rau koj lub sijhawm nyiam [time.sleep (5)]

Pom zoo: