Cov txheej txheem:
Video: Automated Photobooth: 4 Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Qhov no yuav qhia koj yuav ua li cas thiaj ua lub rooj muag khoom yees duab siv lub raspberry pi, lub ntsuas hluav taws xob nrug deb deb, thiab ob peb lwm yam khoom siv ntxiv. Kuv xav ua ib qhov haujlwm uas siv ob yam khoom siv khoos phis tawj thiab ib txoj haujlwm uas siv tau zoo. Kuv tshawb fawb cov phiaj xwm zoo li no ntawm nplooj ntawv raspberry pi cov peev txheej, qee qhov ntawm cov haujlwm no yog kev suav lub cev nrog nab hab sej, thiab micro me selfie. Ib qho ntawm no tau qhia tias yuav siv lub koob yees duab raspberry pi li cas thiab lwm qhov pom tias yuav siv lub tshuab ntsuas nrug deb li cas.
Kauj ruam 1: Cov ntaub ntawv
Ua ntej peb pib tsim peb lub voj voog koj yuav xav tau qee cov ntaub ntawv:
1 x Raspberry Pi 3
1 x T-Cobbler
1 x Pi Lub Koob Yees Duab
1 x Ultrasonic Distance Sensor
3 x RGB LEDs
10 x 330 Ohms Resistors
1 x 560 Ohms Resistor
5 x Spool ntawm cov xim sib txawv xim
1 x Breadboard
Kauj ruam 2: Tsim lub Circut
Nov yog txoj hauv kev uas kuv tau mus txog txuas kuv lub Circuit:
1. Txhawm rau ua qhov Circuit no koj yuav xav ntsaws lub koob yees duab Raspberry Pi rau lub qhov (socket) uas tsim nyog
2. ntsaws T-Cobbler rau ntawm daim ntawv tais.
3. Siv kev cai ntev jumper cables txuas ib qho rau txoj kev tsheb nqaj hlau thiab ib qho mus rau txoj kev tsheb nqaj hlau
4. Ntsaws rau hauv qhov ntsuas nrug deb deb thiab ntsaws 'vcc' txhais ceg rau hauv hwj chim, 'gnd' rau hauv av, 'trig' rau hauv GPIO tus pin, thiab 'ncho' rau hauv 330 ohms resistor uas txuas rau 560 ohms resistor uas txuas nrog hauv av thiab tus lej GPIO.
5. Muab peb lub RGB LEDs tso rau ntawm lub khob cij txuas hauv qab txuas lub anode ntawm LEDs rau lub zog, thiab txuas cov ceg sib txawv uas tswj cov xim ntawm LEDs rau 330 ohms resistors thiab tom qab ntawd mus rau GPIO pins.
Kauj Ruam 3: Txoj Cai
Txhawm rau kom muaj Raspberry Pi siv GPIO pins peb yuav xav tau tus lej pins ua qee yam. Txhawm rau ua tus lej uas kuv tau ua kuv siv sej 3 IDLE. Cov cai uas kuv tau ua siv RPi. GPIO ntxiv rau lub tsev qiv ntawv gpiozero kom ua haujlwm. Muaj cov txheej txheem rau cov xim sib txawv thiab muaj lub luag haujlwm uas suav qhov nrug deb uas siv lub ntsuas nrug deb nrug deb thiab thaum muaj qee yam hauv nws nws yuav qhib lub koob yees duab pi saib ua ntej thiab LEDs yuav suav rov qab thiab tom qab ntawd tau thaij duab.
Nov yog tus lej uas kuv siv:
los ntawm picamera ntshuam PiCamera los ntawm gpiozero ntshuam khawm, LED los ntawm lub sijhawm ntshuam ntshuam ntshuam RPi. GPIO li GPIO lub sijhawm ntshuam
r = [LED (23), LED (25), LED (12)]
g = [LED (16), LED (20), LED (21)] b = [LED (17), LED (27), LED (22)] khawm = Khawm (24) GPIO.setmode (GPIO. BCM) GPIO_TRIGGER = 19 GPIO_ECHO = 26 GPIO.setup (GPIO_TRIGGER, GPIO. OUT) GPIO.setup (GPIO_ECHO, GPIO. IN)
def liab (x):
r [x].off () g [x].on () b [x].on ()
def tawm (x):
r [x].on () g [x].on () b [x].on ()
def tawm ():
r [0].on () g [0].on () b [0].on () r [1].on () g [1].on () b [1].on () r [2].on () g [2].on () b [2].on ()
def ntsuab (x):
r [x].on () g [x].off () b [x].on ()
def xiav (x):
r [x].on () g [x].on () b [x].off ()
def khiav ():
camera.capture ('selfie.jpg') camera.stop_preview ()
def nrug ():
GPIO.output (GPIO_TRIGGER, True) time.sleep (0.00001) GPIO.output (GPIO_TRIGGER, Cuav) StartTime = time.time () StopTime = time.time () thaum GPIO.input (GPIO_ECHO) == 0: StartTime = sijhawm.time () thaum GPIO.input (GPIO_ECHO) == 1: StopTime = time.time () TimeElapsed = StopTime - StartTime nrug = (TimeElapsed *34300) / 2 rov qab nrug
tawm ()
thaum muaj tseeb: d = nrug () yog int (d) <= 30: nrog PiCamera () raws li lub koob yees duab: camera.start_preview () liab (0) pw (1) xiav (1) pw (1) ntsuab (2) pw (1) tawm () camera.capture ('selfie.jpg') camera.stop_preview ()
Pom zoo:
Arduino Controller rau Automated 360 ° Khoom Duab: 5 Kauj Ruam (nrog Duab)
Arduino Controller rau Automated 360 ° Cov Duab Duab: Cia peb tsim lub arduino raws tus tswj hwm uas tswj lub steppermotor thiab lub koob yees duab kaw. Ua ke nrog steppermotor tsav turntable, qhov no yog lub zog muaj zog thiab tus nqi qis rau kev siv tshuab 360 ° kev yees duab lossis cov duab thaij duab. Tsis siv neeg
Xaiv Cov Kauj Ruam Tsav Tsheb thiab Tsav Tsheb rau Arduino Automated Shade Screen Project: 12 Cov Kauj Ruam (nrog Duab)
Xaiv Cov Kauj Ruam Tsav Tsheb thiab Tsav Tsheb rau Arduino Automated Shade Screen Project: Hauv Cov Lus Qhia no, Kuv yuav hla cov kauj ruam uas kuv tau xaiv los xaiv Lub Kauj Ruam Tsav Tsheb thiab Tsav Tsheb rau qhov ua piv txwv Automated Shade Screen project. Cov ntxaij vab tshaus ntxoov ntxoo yog qhov nrov thiab pheej yig Coolaroo tes cranked qauv, thiab kuv xav hloov
Cov Duab Duab Duab thiab Cov Duab 1: 4 Cov Kauj Ruam (nrog Duab)
Cov Duab Duab Cubes thiab Cov Duab 1: Thaum sim nrog qee cov ntoo ntoo thiab cov duab los qhia, kuv pom ob peb txoj hauv kev los ua cov voos thiab lwm yam duab los ntawm cov khoom siv yooj yim. Los ntawm kev muab cov no los ua Cov Ntawv Qhia, Kuv vam tias yuav txhawb nqa kev ua si thiab kev kawm. Kev hloov pauv ntawm qhov kev qhia no
Yuav Ua Li Cas Thiaj Li Tshem Tawm Lub Computer Nrog Cov Kauj Ruam Yooj Yim thiab Duab: 13 Kauj Ruam (nrog Duab)
Yuav Tsum Tshem Tawm Lub Khoos Phis Tawj Li Cas Nrog Cov Kauj Ruam Yooj Yim thiab Duab: Nov yog cov lus qhia txog yuav ua li cas tshem lub PC. Feem ntau ntawm cov khoom siv yooj yim yog hloov pauv thiab tshem tawm tau yooj yim. Txawm li cas los xij nws yog ib qho tseem ceeb uas koj tau koom nrog nws. Qhov no yuav pab tiv thaiv koj kom tsis txhob poob ib feem, thiab tseem ua rau kev rov ua dua tshiab
Cov Duab Duab Duab Duab, WiFi Txuas - Raspberry Pi: 4 Cov Kauj Ruam (nrog Duab)
Cov Duab Duab Duab Duab, WiFi Txuas - Raspberry Pi: Nov yog txoj hauv kev yooj yim heev thiab tus nqi qis mus rau cov duab thav duab digital - nrog qhov zoo ntawm kev ntxiv /tshem cov duab hla WiFi ntawm 'nyem thiab luag' siv (pub dawb) xa cov ntaub ntawv . Nws tuaj yeem siv tau los ntawm qhov me me 拢 4.50 Pi Zero. Koj tseem tuaj yeem hloov pauv