Cov txheej txheem:

Cocktail Tshuab Nrog GUI Raspberry: 7 Kauj Ruam (nrog Duab)
Cocktail Tshuab Nrog GUI Raspberry: 7 Kauj Ruam (nrog Duab)

Video: Cocktail Tshuab Nrog GUI Raspberry: 7 Kauj Ruam (nrog Duab)

Video: Cocktail Tshuab Nrog GUI Raspberry: 7 Kauj Ruam (nrog Duab)
Video: 10 самых АТМОСФЕРНЫХ мест Дагестана. БОЛЬШОЙ ВЫПУСК #Дагестан #ПутешествиеПоДагестану 2024, Hlis ntuj nqeg
Anonim
Cocktail Tshuab Nrog GUI Raspberry
Cocktail Tshuab Nrog GUI Raspberry
Cocktail Tshuab Nrog GUI Raspberry
Cocktail Tshuab Nrog GUI Raspberry

Koj nyiam thev naus laus zis thiab tog twg? Txoj haujlwm no yog ua rau koj!

Hauv qhov kev qhia no peb yuav tsim lub tshuab ua cocktail tsis siv neeg nrog cov duab nraaj.

Txhua yam tswj los ntawm raspberry!

Kho: Kuv ua qhov tshiab yooj yim dua thiab pheej yig dua qhov txuas ntawm no

Kauj Ruam 1: Yam Peb Xav Tau:

Txog qhov haujlwm no kuv yuav siv 8 botlle tab sis koj tuaj yeem hloov kho tau yooj yim yog tias koj xav tau tsawg dua lossis ntau dua.

-Raspberry B: Txhua yam yuav tsum ua haujlwm

-8 channel relay: txhua cov channel yuav yog botlle. (1channel = 1bottle)

-Wire qhov tseem ceeb tshaj yog poj niam rau txiv neej.

-8 Dej twj tso kua mis txhua lub twj tso kua mis yuav siv rau ib qho botlle

-Pipe kuv tau 10m.

-Touchscreen 2.8 txhawm rau tso saib tus neeg siv interface

- SD daim npav 8G: tsawg kawg 8GB

-SD daim npav nyeem kuv ntseeg tias feem ntau ntawm koj twb muaj nws tab sis nyob rau hauv rooj plaub.

-Cov ntim rau haus, Kuv cia koj xaiv raws li nws yuav nthuav tawm ntawm koj lub tswv yim. Kuv lub tsheb muaj 1.5liter

Kauj Ruam 2: Teeb Raspberry Pi

Teem Raspberry Pi
Teem Raspberry Pi
Teem Raspberry Pi
Teem Raspberry Pi
Teem Raspberry Pi
Teem Raspberry Pi

Txhawm rau siv lub raspbery thiab lub vijtsam kov, peb yuav xav tau hloov kho duab ntawm raspbian

Qhov thib 3 software:

-Adafruit hloov kho duab ntawm raspbian

-Win32diskimager los hlawv cov duab ntawm daim npav SD

-Putty los txuas rau hauv tej thaj chaw deb mus rau raspbery

WIn32 disk daim duab:

Tom qab rub tawm nruab nws.

Qhib nws, 1/ koj yuav pom "ntaus ntawv" feem ntau lub neej ntawd yog qhov zoo (yog tias koj tsuas muaj daim npav sd txuas nrog)

2/ Nyem rau ntawm lub cim xiav cim thiab xaiv cov duab raspbian jessie koj tau rub tawm

3/ Nyem sau thiab nws ua tiav.

Tam sim no koj tuaj yeem ntxig daim npav rau raspberry.

Putty:

Nws tso cai rau peb txuas ntawm SSH, qhib Putty (tsis tas yuav teeb tsa)

-Connect internet cable rau raspberry

-Koj yuav tsum nrhiav tus ip ntawm raspberry 2 txoj hauv kev yooj yim:

-Connect rau koj lub thawv interface koj yuav tuaj yeem pom lub cuab yeej nrog IP

-Txuas lub touchscreen thiab keyboard mus rau lub davhlau ya nyob twg ces ifconfig

Tam sim no hauv Putty nkag mus rau tus ip chaw nyob yuav yog yam zoo li 192.168.0.3 ces nkag mus

-it yuav nug kom ntseeg nyem nyem (duab)

-Login: pi lo lus zais: raspberry

Tawm ntawm lub qhov rais ntawm sab peb yuav rov los nov tom qab

Kauj ruam 3: Txuas lub Vijtsam

Txuas lub Vijtsam
Txuas lub Vijtsam
Txuas lub Vijtsam
Txuas lub Vijtsam
Txuas lub Vijtsam
Txuas lub Vijtsam
Txuas lub Vijtsam
Txuas lub Vijtsam

Qhov tsis yooj yim ntawm lub vijtsam yog tias nws los twb tau nce lawm yog li thaum koj ntsaws nws nws yuav siv txhua tus pin ntawm rasp.

Kuv tau sim txhua tus pin kom paub qhov twg siv ib qho screen (kos duab)

Txhawm rau txuas lub vijtsam nws yuav yog tus pin tib yam li raspberry

Thaum txuas nrog yog tias koj tau teeb tsa raspbian koj yuav tuaj yeem siv nws.

Tswv yim rau qhov screen:

lub luag haujlwm ua qee qhov chaw, yog tias koj nyem rau ntawm nws ces teeb tsa vaj huam sib luag => qib siab => tsis xaiv qhov chaw tshwj tseg rau lub luag haujlwm

Kho qhov nyem ib zaug:

Nyem ib zaug: Yog tias koj nyem siv tsuas yog nyem rau ntawm qhov screen ntawm puty: cd /home/pi/.config => nano libfm.conf

Kab 5 single_click = 0 hloov mus rau single_click = 1

Kauj Ruam 4: Txuas Txuas Txuas/Raspberry

Txuas Txuas Txuas/Raspberry
Txuas Txuas Txuas/Raspberry
Txuas Txuas Txuas/Raspberry
Txuas Txuas Txuas/Raspberry
Txuas Txuas Txuas/Raspberry
Txuas Txuas Txuas/Raspberry

Daim duab qhia rau ib lub twj tso kua dej.

dej twj tso kua mis + = RELAY

twj tso kua dej - = Charger 12V

Kuv siv lub charger 12V (txiav saum) qhov tsis zoo mus rau txhua lub twj tso kua mis (tsis zoo) thiab zoo rau txhua txoj hauv kev ntawm kev xa tawm

Ib lub charger txaus vim tsuas yog ib lub twj tso kua mis yuav ua haujlwm nyob rau lub sijhawm

Rov ua qhov no rau 8 lub twj tso kua mis.

Txhawm rau kawm paub ntau ntxiv txog raspberry thiab xa tawm cov ntsiab lus zoo ntawm no

Kauj ruam 5: Code rau GUI

Code rau GUI
Code rau GUI
Code rau GUI
Code rau GUI

Peb tau ua tiav rau cov khoom siv (yam).

Cia peb tsim Cov Neeg Siv Duab Duab interface:

Tam sim no koj tuaj yeem rov qab mus rau putty ib zaug txuas nrog peb yuav tsim peb cov lej ntawm lub desktop:

cd/tsev/pi/Desktop

qhib ib daim ntawv:

nano haus.sh

kom paub tseeb tias cov ntaub ntawv yog executable

chmod +x drink.sh

thiab paste cov cai:

Yog koj xav hloov qhov chaws:

"GPIO hom tawm" txhais tau tias koj qhib tus pin (yog li qhov txuas txuas qhib)

Gpio = tus pin ntawm raspberry, tab sis tus pin tus cev tsis zoo ib yam ntawm cov kab ke.

Txheeb daim duab.

Yog li yog tias koj xav ntxiv lossis hloov haus tsuas yog hloov lub npe hauv "menu boisson" thiab hauv lub cev ntawm cov cai, koj tuaj yeem pom yooj yim heev txhua qhov dej haus muaj ntu me me ntawm cov cai.

#!/bin/bash thaum muaj tseeb; ua xaiv = "$ (zenity -dav = 400 -siab = 300 --list --column" "--title =" Cocktail "\" cocktail "\" soft "\" shooter "\" cow boy " "ncha $ xaiv rooj plaub" $ {xaiv} "hauv" cocktail ") thaum muaj tseeb; ua xaiv = "$ (zenity --width = 400 --height = 300 --list --column" "--title =" test "\" whiskey coca "\" wodka orange "\" ricard eau "\" tequila txiv kab ntxwv "\" Gin txiv kab ntxwv ")" ncha $ xaiv rooj plaub "$ {xaiv}" hauv "whiskey coca") gpio hom 2 tawm tsaug zog 3 gpio hom 2 input / gpio hom 0 tawm tsaug zog 4 gpio hom 0 input so; "wodka txiv kab ntxwv") hom gpio 3 tawm tsaug zog 2 gpio hom 3 tawm tswv yim / gpio hom 7 tawm tsaug zog 4 gpio hom 7 tawm tswv yim so; "ricard eau") hom gpio 24 tawm tsaug zog 3 gpio hom 24 tawm tswv yim / gpio hom 25 tawm tsaug zog 3 gpio hom 25 tawm tswv yim so; "tequila txiv kab ntxwv") hom gpio 22 tawm tsaug zog 3 gpio hom 22 tawm tswv yim / gpio hom 7 tawm tsaug zog 3 gpio hom 7 tawm tswv yim so; "Gin txiv kab ntxwv") hom gpio 23 tawm tsaug zog 2 gpio hom 23 tawm tswv yim / gpio hom 7 tawm tsaug zog 4 gpio hom 7 tawm tswv yim so; *) ncha "bye" so;; ua tiav; "mos") thaum muaj tseeb; xaiv qhov = "$ (zenity --width = 400 --height = 300 --list --column" "--title =" test "\" orange "\" coca "\" eau ")" echo $ xaiv rooj plaub "$ {xaiv}" hauv "txiv kab ntxwv") hom gpio 7 tawm tsaug zog 6 gpio hom 7 nkag mus so; "coca") gpio hom 0 tawm tsaug zog 6 gpio hom 0 input so;; "eau") gpio hom 25 tawm pw tsaug zog 6 gpio hom 25 tawm tswv yim so; *) ncha "bye" so;; ua tiav; "shooter") thaum muaj tseeb; ua qhov kev xaiv = "$ (zenity -dav = 400 -siab = 300 --list --column" "--title =" kuaj "\" whiskey "\" wodka "\" tequila "\" gin "\" TGV ")" ncha $ xaiv rooj plaub "$ {xaiv}" hauv "whiskey") gpio hom 2 tawm tsaug zog 2 gpio hom 2 input so; "wodka") gpio hom 3 tawm tsaug zog 2 gpio hom 3 tawm tswv yim so; "tequila") hom gpio 22 tawm tsaug zog 2 gpio hom 22 tawm tsam so; "gin") gpio hom 23 tawm tsaug zog 2 gpio hom 23 tawm tsam so; "TGV") hom gpio 22 tawm tsaug zog 1 gpio hom 22 tawm tswv yim / gpio hom 23 tawm tsaug zog 1 gpio hom 23 tawm tswv yim / gpio hom 3 tawm tsaug zog 1 gpio hom 3 tawm tsam so; *) ncha "bye" so;; ua tiav;

"nyuj tub")

thaum muaj tseeb; ua xaiv = "$ (zenity --width = 400 --height = 300 --list --column" "--title =" test "\" ricard Pierre "\" whiskey coca "\" wodka orange "\" gin txiv kab ntxwv "\" tequila txiv kab ntxwv "\" cimetiere ")" ncha $ xaiv rooj plaub "$ {xaiv}" hauv "ricard Pierre") hom gpio 24 tawm tsaug zog 4 gpio hom 24 tawm tswv yim / gpio hom 25 tawm pw 5 gpio hom 25 tawm tswv yim tawg;; "whiskey coca") hom gpio 2 tawm tsaug zog 3 gpio hom 2 tawm tswv yim / gpio hom 0 tawm tsaug zog 6 gpio hom 0 tso tawm so; "wodka txiv kab ntxwv") hom gpio 3 tawm tsaug zog 3 gpio hom 3 tawm tswv yim / gpio hom 7 tawm tsaug zog 6 gpio hom 7 tawm tswv yim so; "gin txiv kab ntxwv") hom gpio 23 tawm tsaug zog 3 gpio hom 23 tawm tswv yim / gpio hom 7 tawm tsaug zog 6 gpio hom 7 tawm tswv yim so; "tequila txiv kab ntxwv") hom gpio 22 tawm tsaug zog 3 gpio hom 22 tawm tswv yim / gpio hom 7 tawm tsaug zog 6 gpio hom 7 tso tawm so; "cimetière") hom gpio 2 tawm tsaug zog 2 gpio hom 2 tawm tswv yim / gpio hom 3 tawm pw tsaug zog 2 gpio hom 3 tawm tswv yim / gpio hom 23 tawm tsaug zog 2 gpio hom 23 tawm tswv yim / gpio hom 25 tawm tsaug zog 2 gpio hom 25 tawm tswv yim / gpio hom 7 tawm pw tsaug zog 1 gpio hom 7 input so;; *) ncha "bye" so;; ua tiav; *) ncha "bye" so;; esac ua

Kauj Ruam 6: Kawg Mounting

Kawg Mounting
Kawg Mounting
Kawg Mounting
Kawg Mounting
Kawg Mounting
Kawg Mounting
Kawg Mounting
Kawg Mounting

Kuv siv rooj tog ntsug los ntawm IKEA tau pheej yig dua los tsim kuv tus kheej.

Kuv txiav ib lub xwmfab los ntawm lub qhov rooj mus rau iav

Kuv tau ua qee qhov hauv lub txee kom hla cov yeeb nkab, cov yeeb nkab ntawm lub twj tso kua mis mus rau ntawd.

Hauv qab kuv tso ib txoj hlua hlau los ntawm lub tshuab cua tshuab nrog lub ntim rau cov dej xau

Kauj Ruam 7: Xaus

Txhua yam ua haujlwm tau zoo tab sis kuv tau ntsib qee qhov teeb meem tsis saib xyuas.

Ob peb qhov teeb meem:

-Qhov xwm txheej nruj me ntsis, thaum koj sau tuaj yeem ua rau nyuaj. -

-Lub ntim rau cov dej haus nyob saum thiab iav hauv qab; nws yuav tsim siphon uas txhais tau tias txawm tias thaum lub twj tso kua mis nres cov kua kom tuaj.

Txhawm rau zam qhov no siv rooj plaub kab rov tav lossis zoo ib yam li kuv koj yuav tsum ua lub qhov me me hauv cov yeeb nkab hauv qhov tsis txaus ntseeg.

Tsis tas li koj tuaj yeem pom kuv muaj cable mus rau txhua qhov uas zoo li tsis zoo, yog li lub rooj zaum kab rov tav yuav yog qhov kev xaiv zoo tshaj plaws.

Qhia:

Muab qee cov ntawv nplaum tso rau ntawm txhua lub thawv kom paub tias haus dej dab tsi uas cov kis tau txuas nrog.

Yog tias koj nyiam cov lus qhia thov pov npav

Pom zoo: