Cov txheej txheem:

Lub Sijhawm Huab Cua: 15 Kauj Ruam (nrog Duab)
Lub Sijhawm Huab Cua: 15 Kauj Ruam (nrog Duab)

Video: Lub Sijhawm Huab Cua: 15 Kauj Ruam (nrog Duab)

Video: Lub Sijhawm Huab Cua: 15 Kauj Ruam (nrog Duab)
Video: 40 Koj Mam Pom Kuv Zoo Nkauj By Huab Vwj 2024, Kaum ib hlis
Anonim
Huab Cua Moos
Huab Cua Moos

Zoo saib desktop moos nrog hnub tim & huab cua tso saib.

Kauj ruam 1: Rub tawm thiab Nruab Software rau RaspberryPI

Rub tawm thiab Nruab Software rau RaspberryPI
Rub tawm thiab Nruab Software rau RaspberryPI

Download "RASPBIAN JESSIE LITE"

Tsim koj lub hard disk tshiab rau DashboardPI

Ntxig lub microSD rau koj lub khoos phis tawj ntawm USB adapter thiab tsim cov duab disk siv cov lus txib dd

Nrhiav koj daim npav microSD tso ntawm df -h hais kom ua, unmount nws thiab tsim cov duab disk nrog daim disk theej daim ntawv dd

$ df -h/dev/sdb1 7.4G 32K 7.4G 1%/media/XXX/1234-5678

$ umount /dev /sdb1

Ceev faj: nco ntsoov tias cov lus txib yog qhov tseeb, koj tuaj yeem ua rau lwm lub disks puas tsuaj nrog cov lus txib no

yog = qhov chaw ntawm RASPBIAN JESSIE LITE duab cov ntaub ntawv ntawm = qhov chaw ntawm koj daim npav microSD

$ sudo dd bs = 4M yog =/path/to/raspbian-jessie-lite.img ntawm =/dev/sdb (ceeb toom: qhov no, nws yog/dev/sdb,/dev/sdb1 yog lub koomhaum uas twb muaj lawm muab faib rau ntawm microSD)

Teeb koj li RaspberriPi

Ntxig koj daim npav microSD tshiab rau raspberrypi thiab siv nws nrog lub ntsuas saib txuas nrog rau HDMI chaw nres nkoj

ID nkag mus

neeg siv: pi pass: raspberry Hloov koj tus lej password kom ruaj ntseg

sudo passwd pi Pab kom RaspberriPi Advanced Options

sudo raspi-config Xaiv: 1 Nthuav Cov Ntaub Ntawv System

9 Advanced Options

A2 Hostname hloov nws mus rau "EnvironmentClock"

A4 SSH Pab kom SSH Server

A7 I2C Pab kom i2c interface Pab kom Askiv/Asmeskas Keyboard

sudo nano /etc /default /keyboard Hloov cov kab hauv qab no: XKBLAYOUT = "peb" Rov Pib PI rau Cov keyboard hloov pauv /cov txheej txheem system hloov kho kom muaj txiaj ntsig

$ sudo kaw -r tam sim no Auto -Txuas rau koj WiFi

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf Ntxiv cov kab hauv qab no kom koj cov raspberrypi tau txuas ncaj qha rau koj lub tsev WiFi (yog tias koj lub wireless network hu ua "linksys" piv txwv, piv txwv li hauv qab no)

network = {ssid = "linksys" psk = "WIRELESS PASSWORD HERE"} Rov pib PI txuas rau WiFi network

$ sudo kaw -r tam sim no

Tam sim no tias koj tus PI yog qhov kawg ntawm lub network hauv zej zog, koj tuaj yeem nkag mus rau nws deb ntawm SSH. Tab sis ua ntej koj yuav tsum tau txais tus IP chaw nws tam sim no muaj.

$ ifconfig Saib rau "inet addr: 192.168. XXX. XXX" hauv cov lus txib hauv qab no tso tawm rau koj tus PI's IP Chaw Nyob Mus rau lwm lub tshuab thiab nkag mus rau koj li raspberrypi ntawm ssh

$ ssh [email protected]. XXX. XXX Pib Txhim kho pob khoom xav tau

$ sudo apt-tau hloov tshiab

$ sudo apt-tau hloov tshiab

$ sudo apt-tau nruab vim git nab-thov python-smbus i2c-tools python-imaging python-smbus build-essential python-dev rpi.gpio python3 python3-pip libi2c-dev

Hloov kho thaj chaw sijhawm hauv cheeb tsam

$ sudo dpkg-reconfigure tzdata xaiv koj lub sijhawm siv lub interface teeb tsa cov npe yooj yim l hais kom ua [xaiv tau]

$ vi ~/.bashrc

ntxiv cov kab hauv qab no:

$ alias l = 'ls -lh'

$ qhov chaw ~/.bashrc Kho VIM default syntax highlighting [yeem]

$ sudo vi/etc/vim/vimrc

tsis pom zoo cov kab hauv qab no:

syntax ntawm Clone Clock repository

$ cd ~ ib

$ git clone https://github.com/khinds10/EnvironmentClock.git Nruab i2c Backpack Python Tsav Tsheb

$ cd ~ ib

$ git clone

$ cd Adafruit_Python_LED_Backpack/

$ sudo nab hab sej setup.py nruab DHT11 Nruab

$ cd ~ ib

$ git clone

$ cd Adafruit_Python_DHT/

$ sudo python setup.py nruab

$ sudo nab hab sej ez_setup.py

$ cd piv txwv/

$ vi simpletest.py Hloov cov kab hauv qab no:

sensor = Adafruit_DHT. DHT11 Saib kab ntawv tawm

tus pin = 'P8_11' Uncomment kab thiab hloov tus lej tus lej rau 16

tus pin = 16 Khiav qhov kev xeem

nab hab sej simpletest.py

Koj yuav tsum pom qhov ntsuas ntsuas ntawm Temp thiab Vaum pom ntawm kab hais kom ua.

Kauj Ruam 2: Cov Khoom Siv Xav Tau: 1.2 Nti LED Zaub

Cov Khoom Siv Xav Tau: 1.2 Nti LED Zaub
Cov Khoom Siv Xav Tau: 1.2 Nti LED Zaub

Kauj Ruam 3: Cov Khoom Siv Xav Tau: DHT11 Humidistat

Cov Khoom Siv Xav Tau: DHT11 Humidistat
Cov Khoom Siv Xav Tau: DHT11 Humidistat

Kauj Ruam 4: Cov Khoom Siv Xav Tau: 2.6 "Digole Display

Cov Khoom Siv Xav Tau: 2.6
Cov Khoom Siv Xav Tau: 2.6
Cov Khoom Siv Xav Tau: 2.6
Cov Khoom Siv Xav Tau: 2.6

Kauj Ruam 5: Cov Khoom Siv Xav Tau: RaspberriPi Zero (lossis Tsis Siv Neeg RaspberriPi Yuav Tsum Ua Haujlwm)

Kauj Ruam 6: Tsim thiab Hlau Cov Zaub

Tsim thiab Hlau Cov Zaub
Tsim thiab Hlau Cov Zaub

Npaj Digole Display rau i2C

Nyob rau sab nraum qab ntawm Digole Zaub, siv lub jumper los muab cov zaub los siv i2c raws tu qauv

Kauj Ruam 7: Luam tawm qhov Project Enclosure

Luam qhov Project Enclosure
Luam qhov Project Enclosure

Siv lub tshuab luam ntawv 3D luam tawm cov ntawv ntim nrog rau hauv 'daim ntawv/' nplaub tshev..x3g cov ntaub ntawv tau tshaj MakerBot. Koj kuj tseem tuaj yeem siv cov.stl thiab.blend (Blender Program) cov ntaub ntawv los kho thiab tsim koj tus kheej txhim kho rau kev tsim.

Siv 4 lub qhov ntswj ntsia hlau thiab txuas lub vaj huam sib luag pem hauv ntej (nrog rau 2 qhov) rau 4 sab cev. Tom qab ntawd haum cov lus qhia hauv txhua qhov ntawm lub qhov.

Kauj Ruam 8: Txuas 7 Ntu thiab Digole Display Siv Kub Glue Gun los tuav lawv hauv qhov chaw

Txuas 7 Ntu thiab Digole Zaub Siv Kub Rab Phom Phom los tuav lawv hauv qhov chaw
Txuas 7 Ntu thiab Digole Zaub Siv Kub Rab Phom Phom los tuav lawv hauv qhov chaw

Kauj Ruam 9: Npaj Cov Hluav Taws Xob rau Kev Sib Txuas

Npaj Cov Hluav Taws Xob rau Kev Sib Txuas
Npaj Cov Hluav Taws Xob rau Kev Sib Txuas

Kuv siv tus qauv dhia xov tooj thiab lub tshuab txiav hlau los hle cov hlau liab qab hauv nruab nrab ntawm cov xov hlau kom kuv tuaj yeem muaj cov pawg txuas ua ke ua ke nrog rab phom kub kub. (Hauv daim duab hauv qab no yog kuv pawg ua ke 5V / GND / SCA / thiab SCL xov hlau.)

Kauj ruam 10:

Duab
Duab

Pib xaim chav tsev siv daim duab thaiv kab hauv qab no raws li phau ntawv qhia.

7 Segment display D -> SDA C -> SCL + -> 5v GND -> GND IO -> 5v Digole Display GND -> GND DATA -> SDA CLK -> SCL VCC -> 3V DHT11 Humidistat VCC -> 5V GND - > GND DATA -> GPIO 16 / PIN 36

Kauj Ruam 11: Txuas Txhua Qhov Hauv Sab Hauv Cov Ntawv Luam

Txuas Txhua Qhov Hauv Sab Hauv Cov Ntawv Luam
Txuas Txhua Qhov Hauv Sab Hauv Cov Ntawv Luam

Kauj Ruam 12: Txuas Txhua Qhov Hauv Sab Hauv Cov Ntawv Luam

Txuas Txhua Qhov Hauv Sab Hauv Cov Ntawv Luam
Txuas Txhua Qhov Hauv Sab Hauv Cov Ntawv Luam

Kauj Ruam 13: Ua tiav Kev Tsim Kho

Ua tiav Kev Tsim Kho
Ua tiav Kev Tsim Kho

Kua nplaum humidistat rau sab nraum qab vaj huam sib luag, thiab khiav USB cable los ntawm lwm lub vaj huam sib luag sab nraub qaum kom lub zog ua haujlwm. Txuas lub nraub qaum nrog tsuas yog 2 tus ntsia hlau nyob rau hauv rooj plaub koj xav tau txhawm rau txhawm rau kho.

Kauj ruam 14: Teeb Startup Scripts

Configure Application kom ua haujlwm raug nyob rau hauv settings.py teeb tsa cov ntaub ntawv Nrhiav cov ntaub ntawv teeb tsa.py thiab hloov kho rau koj qhov chaw tam sim no

# forecast.io API qhov tseem ceeb rau cov ntaub ntawv huab cua hauv zosweatherAPIURL = 'https://api.forecast.io/forecast/'weatherAPIKey =' KOJ API KEY FOR FORASAST. IO '

# yeem rau kev khiav lub ntsuas kub/av noo loggerdeviceLoggerAPI = 'mydevicelogger.com'

# tshawb google kom tau txais Latitude/Longitude rau koj lub tsev qhov chaw nyob = 41.4552578longitude = -72.1665444

$ crontab -e

Ntxiv cov kab hauv qab no:

@reboot nohup nab hab sej /home/pi/EnvironmentClock/clock.py>/dev/null 2> & 1

@reboot nohup nab hab sej /home/pi/EnvironmentClock/display.py>/dev/null 2> & 1

Txheeb xyuas cov zaub pib ua haujlwm ntawm reboot

$ sudo rov pib dua OPTIONAL: Temp Logger rau API tsab ntawv txhua 10 feeb

$ crontab -e Ntxiv cov kab hauv qab no:

*/10 * * * * nab hab sej /home/pi/EnvironmentClock/temp-check.py

YOOJ YIM: Tsim koj tus kheej cov duab huab cua los ua rau ntawm cov zaub

Upload koj tus kheej 128x128 cov ntaub ntawv rau hauv qab no URL:

www.digole.com/tools/PicturetoC_Hex_convert…

Xaiv koj cov ntaub ntawv duab rau upload, ntxiv qhov loj me koj xav kom nws nyob ntawm qhov screen (Dav/Qhov siab)

Xaiv "256 Xim rau Xim OLED/LCD (1 byte/pixel)" hauv "Siv rau" qhov poob qis

Tau txais cov txiaj ntsig hex.

Ntxiv cov hex cov zis rau cov zaub/ tsim/ header (.h) cov ntaub ntawv, siv lwm tus los ua cov lus qhia rau cov lus sib xyaw.

Suav nrog cov ntawv tshiab hauv cov ntawv digole.c #include myimage.h

Suav nrog kab lus hais kom ua tshiab txuas rau koj cov ntaub ntawv duab hauv. Nco tseg: cov lus txib hauv qab no yog hais kos koj cov duab ntawm txoj haujlwm 10 pixels tshaj 10 pixels nqis. Koj tuaj yeem hloov nws mus rau X sib txawv, Y tswj hwm, koj tseem tuaj yeem hloov qhov muaj nuj nqis 128, 128 rau qhov loj me me uas koj cov duab tshiab yog.

} lwm yog (strcmp (digoleCommand, "myimage") == 0) {drawBitmap256 (10, 10, 128, 128, & myimageVariableHere, 0); // myimageVariableQhov no yog txhais hauv koj (.h) cov ntaub ntawv}

Tam sim no rov tsim dua (tsis quav ntsej qhov ua tsis raug) hauv qab no kom muaj koj cov duab tshiab ua nrog cov lus txib hauv qab no.

$./digole myimage Re-Building [Muaj] Digole Display Driver rau koj qhov kev hloov pauv tau

$ cd zaub/tsim $ gcc digole.c $ mv a.out../../digole $ chmod +x../../digole

Pom zoo: