Cov txheej txheem:

Tswb Tswb Tswb Tswb (Txhim Kho Thaum Sawv Ntxov Thaum Ntxov): 13 Kauj Ruam
Tswb Tswb Tswb Tswb (Txhim Kho Thaum Sawv Ntxov Thaum Ntxov): 13 Kauj Ruam

Video: Tswb Tswb Tswb Tswb (Txhim Kho Thaum Sawv Ntxov Thaum Ntxov): 13 Kauj Ruam

Video: Tswb Tswb Tswb Tswb (Txhim Kho Thaum Sawv Ntxov Thaum Ntxov): 13 Kauj Ruam
Video: Plab Plab Ntswg..(Pluav Pluav Ntswg) Maiv Twm New Song 2023-2024 2024, Hlis ntuj nqeg
Anonim
Image
Image
Cov Khoom Siv Xav Tau
Cov Khoom Siv Xav Tau

Teem caij koj tus kheej lub hnub tuaj, txhim kho sawv ntxov

Qhov tseeb tsim tsis raug, teem sijhawm rau koj tus kheej lub hnub tuaj! Thaum nruab hnub, lub teeb xiav nyob rau hauv tshav ntuj ua rau peb saib xyuas, nco, qib zog, lub sijhawm tshuaj tiv thaiv, thiab lub siab tag nrho. Lub teeb xiav txwv tsis pub tso melatonin, rau sawv ntxov siv xwb:)

Kauj Ruam 1: Flashing RaspberriPi Hard Disk / Install Required Software (Siv Ubuntu Linux)

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 a

$ 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: hauv qhov no, nws yog /dev /sdb, /dev /sdb1 yog lub koomhaum muab faib 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 rau kev nyab xeeb

sudo passwd pib

Pab kom RaspberriPi Advanced Options

sudo raspi-teeb tsa

Xaiv: 1 Nthuav Cov Ntaub Ntawv System

9 Advanced Options

A2 Hostname hloov nws mus rau "SOLARLAMP"

A4 SSH Pab kom SSH Server

A7 I2C Pab kom i2c interface

P4 SPI Enable/Disable automatic loading of SPI kernel module

Pab kom Askiv/Asmeskas Keyboard

sudo nano/etc/default/keyboard

Hloov cov kab hauv qab no: XKBLAYOUT = "peb"

Rov pib dua PI rau Keyboard hloov pauv / cov txheej txheem txheej txheem hloov pauv kom muaj txiaj ntsig

$ sudo kaw -r tam sim no

Auto-Txuas rau koj li WiFi

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Ntxiv cov kab hauv qab no kom muaj koj cov raspberrypi txuas nrog koj lub WiFi hauv tsev (yog tias koj lub wireless network npe "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 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 cov pob khoom xav tau

$ sudo apt-tau hloov tshiab

$ sudo apt-tau hloov tshiab

$ sudo apt-tau nruab memcached vim git python-gpiozero python-smbus i2c-tools python-imaging python-smbus build-essential python-dev rpi.gpio python3 python3-pip python-memcache python3-spidev nab hab sej-spidev

Hloov kho thaj chaw sijhawm hauv cheeb tsam

$ sudo dpkg-reconfigure tzdata

xaiv koj lub sijhawm siv lub interface

Teeb 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

Txhim kho VIM default syntax highlighting [yeem]

sudo vi/etc/vim/vimrc

tsis pom zoo cov kab hauv qab no:

syntax yog

Nruab i2c Python Tsav Tsheb

Nruab NeoPixel Driver raws li hauv qab no

sudo apt-tau nruab tsim-qhov tseem ceeb nab hab sej-dev git scons swig

sudo pip3 nruab -hloov kho setuptools

sudo pip3 nruab rpi_ws281x

cd rpi_ws281x

saib xyuas

cd python

sudo python setup.py nruab

cd piv txwv/

sudo nab hab sej strandtest.py

Kauj Ruam 2: Cov Khoom Xav Tau

Cov Khoom Siv Xav Tau
Cov Khoom Siv Xav Tau
Cov Khoom Siv Xav Tau
Cov Khoom Siv Xav Tau

5V Fais Fab Khoom

I2C 7 SEGMENT

Microchip MCP3008 Cov

Momentary Tactile Tact Push Button Switch [x5]

PI ZERO W.

Logarithmic Swb Potentiometer

WS2812B Ib tus zuj zus tuaj yeem hais qhia RGB LED Sawb [x4]

Nyias Plexi Iav Ntawv

Frosted Txau Xim

Kauj Ruam 3: 3D Luam Tus Tswj Xyuas Vaj Huam Sib Luag

Siv cov.x3g cov ntaub ntawv suav nrog hauv "3D Luam/" nplaub tshev luam tawm lub ntsiab tswj vaj huam sib luag npog, uas yuav tsev slider, nyees khawm, LED thiab 7 ntu zaub

Kauj Ruam 4: Tsim Lub Teeb

Tsim Lub Teeb
Tsim Lub Teeb
Tsim Lub Teeb
Tsim Lub Teeb
Tsim Lub Teeb
Tsim Lub Teeb

Tsim Ntoo Ncej

Kuv tau tsim lub thav duab ntoo rau cov kab txaij LED kom nyob hauv thiab pleev xim nws dub.

Xim Plexi iav

Nrog qee cov tshuaj tsuag txau, pleev xim rau iav kom nws tsis pom lub teeb los ntawm kab txaij.

Mount Sawb

Siv cov kab xev yooj yim thiab cov nplaum ntawm sab nraub qaum ntawm cov kab txaij LED, teeb 4 daim kab xev rau lub hauv paus ntoo

Kauj Ruam 5: Mount Nyees khawm

Nyees khawm
Nyees khawm
Nyees khawm
Nyees khawm

Mount cov nyees khawm thiab cov xim daj, Kuv tau siv cov kua nplaum kub los tuav cov nyees khawm thiab LED nyob hauv qhov chaw.

Kauj Ruam 6: Mount Chip ntawm Slider

Mount Chip ntawm Slider
Mount Chip ntawm Slider

Ua raws li cov txheej txheem muab, muab cov kab hluav taws xob tso rau hauv qhov chaw thiab txuas rau logarithmic slider, lo cov nti nrog cov laug txuas rau sab nraub qaum.

Kauj Ruam 7: Txuas Cov Khoom Siv

Txuas Cov Khoom Siv
Txuas Cov Khoom Siv

Siv cov txheej txheem hauv qab no txhawm rau txuas txhua yam khoom kom lub teeb ua haujlwm kom raug.

Kauj Ruam 8: Hlau Vaj Huam Sib Luag

Hlau Vaj Huam Sib Luag
Hlau Vaj Huam Sib Luag

Txuas tag nrho cov xov hlau mus rau cov khoom sib txuas ntawm lub vaj huam sib luag txhawm rau txuas rau raspberrypi.

Kauj Ruam 9: Hlau Pi

Hlau Pi
Hlau Pi

Thaum kawg muab PiZero tso rau sab nraum qab ntawm lub rooj ntoo LED nrog daim kab xev lossis kua nplaum thiab tom qab ntawd txuas cov xov hlau raws li cov phiaj xwm muab.

Kauj ruam 10: Mount Vaj Huam Sib Luag

Mount Vaj Huam Sib Luag
Mount Vaj Huam Sib Luag

Ceev cov tswj vaj huam sib luag rau hauv qab ntawm rooj plaub LED.

Kauj Ruam 11: Siv Plexi iav

Thov Plexi iav
Thov Plexi iav

Txuas txiav thiab pleev xim rau iav plexi rau hauv rooj plaub LED nrog cov ntsia hlau

Kauj Ruam 12: Mount ntawm phab ntsa

Mount ntawm phab ntsa
Mount ntawm phab ntsa
Mount ntawm phab ntsa
Mount ntawm phab ntsa

Kauj ruam 13: Ua tiav

Teeb tus neeg siv crontab

Nkag mus rau kab hauv qab no rau ib feeb dhau ib feeb crontab

$ crontab -e

0 3 * * * nab hab sej /home/pi/SolarBar/Alarm.py>/dev/null 2> & 1

@reboot sej /home/pi/SolarBar/Buttons.py>/dev/null 2> & 1

@reboot sej /home/pi/SolarBar/ControlPanel.py>/dev/null 2> & 1

@reboot sej /home/pi/SolarBar/Slider.py>/dev/null 2> & 1

Teeb tus neeg siv hauv paus crontab (lub tsev qiv ntawv no xav tau kev nkag mus rau hauv paus) Teeb "ntawm reboot" kom khiav lub tswm ciab nab nab ntawv ib txhis

$ sudo ua

$ crontab -e

@reboot sej /home/pi/SolarBar/LEDs.py>/dev/null 2> & 1

Pom zoo: