Cov txheej txheem:

Rasberry Pi Zero W Nrog Arduino TfT (ili9341): 3 Cov Kauj Ruam
Rasberry Pi Zero W Nrog Arduino TfT (ili9341): 3 Cov Kauj Ruam

Video: Rasberry Pi Zero W Nrog Arduino TfT (ili9341): 3 Cov Kauj Ruam

Video: Rasberry Pi Zero W Nrog Arduino TfT (ili9341): 3 Cov Kauj Ruam
Video: Cómo fabricar tu propia Game Boy con la Retroflag GPi Case y una Raspberry Pi Zero. 2024, Kaum ib hlis
Anonim
Rasberry Pi Zero W Nrog Arduino TfT (ili9341)
Rasberry Pi Zero W Nrog Arduino TfT (ili9341)

Yog li tom qab ib lub lim tiam ntawm kev tshawb fawb, debugging thiab kev sim, thaum kawg kuv tau txais kuv SeedStudio 2.8 Arduino TfT ua haujlwm ntawm kuv RasPi 0 W nrog Kivy thiab GPIO los ua lub ntse saib, lossis cov khoom me me pom. Raws li txhua qhov xav tau cov ntaub ntawv tau tawg hla ntau lub vev xaib Kuv xav tias kuv yuav tso ib yam dab tsi ua ke pib nrog thaiv kab ke. Tsuas yog sau tseg qhov kov lub ntsej muag tsis ua haujlwm thiab xav tau cov pins analog 0-3. Kuv tuaj yeem tau txais nws ua haujlwm tom qab.

Kuv tab tom siv Raspberry Pi Stretch ua haujlwm tsim thiab kuv xav tias koj twb muaj daim duab duab ntawm lub USB tsav. Kuv tsis tau sim ntawm Jessie lossis lwm yam kev cuam tshuam. Kuv kuj tseem xav tias koj muaj kev paub dav dav ntawm kev siv cov khoom siv hluav taws xob, cov khoom siv hluav taws xob yooj yim, thiab qee qhov kev paub linux.

Phau ntawv qhia no yuav pib zoo li koj muaj kev txhim kho Stretch tshiab.

Kauj Ruam 1: Kauj Ruam 1: Txuas Hluav Taws Xob

Kauj ruam 1: Kev thaiv kab
Kauj ruam 1: Kev thaiv kab

SeedStudio 2.8 TfT zaub rau Arduino yuav siv 8 xov hlau los txuas cov zaub rau RasPi siv SPI interface.

NCO TSEG: Yog tias koj tsis muaj lub mini HDMI cable, koj tuaj yeem siv cov khoom sib txuas "TV" nyob saum toj ntawm lub chaw nres nkoj usb thiab txuas lub thoob me me ntsaws rau ntawm tus pin. Tus lej square yog qhov zoo thiab qhov puag ncig ib qho tsis zoo. Nrog tus poj niam txuas, muab qhov zoo rau ntawm qhov txuas (nruab nrab) ntawm lub thoob ntsaws thiab qhov tsis zoo rau rooj plaub. Ntawm tus txiv neej kawg pom cov xov tooj twg yog rooj plaub (siv lub ntsuas ohm), thiab muab nws txuas rau hauv av ntawm RCA ntsaws. Txuas ob lub xov hlau txuas ua ke. Fais fab ntawm Pi los ntsuas yog tias nws ua haujlwm.

Thaum pi tau nce thiab khiav hloov tshiab Pi nrog:

sudo rpi-hloov tshiab

sudo hloov tshiab

sudo txawj tej yam ntxiv

Yog li txhawm rau xaim cov zaub no txuas nrog cov hauv qab no:

Arduino TfT Pins rau RasPi Pins

MOSI D11 rau GPIO 10 (SPI_MOSI) MISO D12 rau GPIO 09 (SPI_MISO)

SCK D13 rau GPIO 11 (SPI_CLK)

TFT_CS D5 rau GPIO 08 (SPI_CE0_N)

TFT_DC D6 to GPIO 24

5V rau 5 Volt Fais Fab Rail

Gnd rau hauv av

Rov pib dua rau GPIO 23

Ib qho ntxiv koj tuaj yeem txuas lub jumper ntawm sab nraub ntawv "Backlight" thiab txuas cov xov ntxiv los ntawm TfT ntawm tus pin D7 rau ib tus pin ntawm RasPi los tswj lub teeb nraub qaum.

Kauj Ruam 2: Kauj Ruam 2: Teeb Raspberry Pi

Fais fab ntawm Pi thiab qhib lub davhlau ya nyob twg CTRL+ALT+T yog tus yuam sij nrawm.

Hom: sudo raspi-teeb tsa

Scroll cia rau kev xaiv cuam tshuam thiab xaiv SPI thiab nias nkag mus. Xaiv "Yog" kom qhib tau. Yog tias nws nug kom rov pib dua xaiv tsis tau. Tsis tas li thaum nyob hauv cov ntawv qhia no pab kom SSH. Default password yog raspberry. Txhawm rau SSH rau hauv Pi hom hauv pi@Raspberry lossis qhov uas koj tau teev npe koj Pi ntawm lwm lub khoos phis tawj.

Hom tom ntej: sudo nano /boot/config.txt

Nqes mus rau qhov nws hais "framebuffer_width" thiab "framebuffer_height" hloov qhov txiaj ntsig mus rau 680 thiab 420 feem, thiab tsis pom zoo cov kab ntawd.

Txoj cai hauv qab ntawd muaj "hdmi_group/_mode" tsis pom zoo cov ntawd thiab hloov qhov txiaj ntsig rau 2 thiab 87 feem thiab ntxiv "hdmi_cvt = 680 420 60 1 0 0 0" raws li kab tshiab.

Scroll qis dua mus txog thaum koj mus txog "dtparam = i2c_arm = on" thiab "dtparam = spi = on" tsis pom zoo rau ob kab no.

Tam sim no txhua txoj hauv kev hauv qab ntxiv cov kab no:

dtoverlay = rpi-display #(hloov nrog ib qho uas ua haujlwm nrog koj tus tsav tsheb, im siv ili9341, GitHub dtoverlay li)

dtparam = tig 90 #(0 yog daim duab)

dtparam = ceev = 48000000

dtparam = xohms = 100

dtparam = debug = 4

gpu_mem = 64

Nias CTRL+X, tom qab ntawd Y thiab nkag mus khaws cov ntawv.

Tom ntej: sudo nano /boot/cmdline.txt Thaum kawg ntawm kab ntxiv: fbcon = daim ntawv qhia: 10 fbcon = font: ProFont6x11

Thaum kawg: sudo nano /etc /modules

Ntxiv: spi-bcm2835

xwb-bcm2835

i2c-bcm2708

flexfb

fbtft_device

Yog tias koj tau ua txhua yam kom raug, tsis txhob siv lub vijtsam dawb txhua lub sijhawm, tom qab lub khau raj tau ua tiav thauj cov ntsiav koj yuav tsum pom lub vijtsam dub ntawm TfT. Qhov no yog xov xwm zoo thiab txhais tau tias RasPi tab tom sib tham nrog TfT dhau ntawm SPI interface. Tsis tas li koj tuaj yeem pom lub khau raj thauj khoom tshuaj ntsuam ntawm TfT nws tus kheej.

Kauj Ruam 3: Kauj Ruam 3: Fbturbo Config thiab FBCP Install

Tam sim no yog tias koj xav sim thiab paub tseeb tias TfT tsom iav cov zaub.

Hom: sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.conf

Qhov twg nws hais "Xaiv" fbdev ""/dev/fb0"

Hloov qhov "0" mus rau "1". Qhov no yuav tam sim no tso lub HDMI zaub rau TfT screen. Tsuas yog rov pib Pi thiab nws yuav tsum thauj lub desktop mus rau TfT. Hloov nws rov qab mus rau "0" thiab rov qhia dua.

Tam sim no peb yuav tsum teeb tsa cmake txhawm rau sau fbcp thiab fbcp kom tso cai rau HDMI tsom iav rau SPI interface.

Yog li: sudo apt-tau nruab cmake

Thaum uas ua tiav: sudo git clone

mkdir ua

cd tsim

cmake/home/pi/rpi-fbcp (lossis txhua qhov chaw koj rub tawm rpi-fbcp file rau)

ua

sudo nruab fbcp/usr/local/bin/fbcp

Thaum qhov ntawd ua tiav yog tias koj ntaus ntawv "fbcp &" TfT yuav tsum tsom iav koj lub desktop.

Txhawm rau ua kom nws khiav ntawm kev hloov kho rc.local cov ntaub ntawv los ntawm: sudo nano /etc/rc.local. Koj tuaj yeem tshem tawm qhov tsis tsim nyog "yog" hais kom ua thiab ntxiv "fbcp &" nyob rau hauv qhov chaw. Tawm qhov tawm 0 hauv qab.

Tom qab txhua qib tau ua tiav koj lub TfT zaub yuav tsum tau nce thiab khiav thiab pib pib tom qab khau raj. Koj tuaj yeem hloov pauv qhov ntau thiab tsawg hauv /boot/config.txt lossis tsis txaus siab rau kev saib xyuas yog tias koj muaj ciam teb dub.

Pom zoo: