Cov txheej txheem:

Tig Raspberry Pi Zaub thiab Touchscreen: 4 Kauj Ruam
Tig Raspberry Pi Zaub thiab Touchscreen: 4 Kauj Ruam

Video: Tig Raspberry Pi Zaub thiab Touchscreen: 4 Kauj Ruam

Video: Tig Raspberry Pi Zaub thiab Touchscreen: 4 Kauj Ruam
Video: Sib Hawm Dhau (Time Passed) Music Video by: Deeda/Dib Xwb 2024, Kaum ib hlis
Anonim
Tig Raspberry Pi Zaub thiab Touchscreen
Tig Raspberry Pi Zaub thiab Touchscreen
Tig Raspberry Pi Zaub thiab Touchscreen
Tig Raspberry Pi Zaub thiab Touchscreen

Nov yog qhov qhia qhia yooj yim los qhia koj yuav ua li cas tig cov zaub thiab kov lub vijtsam nkag rau ib qho Raspberry Pi uas siv Buster Raspbian kev ua haujlwm, tab sis kuv tau siv txoj hauv kev no txij li Jessie. Cov duab siv hauv qhov no yog los ntawm Raspberry Pi 3 B+ khiav Raspbian Buster nrog 3.5 TFT LCD touchscreen.

Lub touchscreen siv yog qhov zoo heev, yog tias koj xav tau ib qho koj tuaj yeem pom nws ntawm qhov txuas no los ntawm amazon:

www.amazon.com/Raspberry-320x480-Monitor-Raspbian-RetroPie/dp/B07N38B86S/ref=asc_df_B07N38B86S/? = c & hvdvcmdl = & hvlocint = & hvlocphy = 9027898 & hvtargid = pla-667157280173 & psc = 1

Kauj Ruam 1: Hloov Cov Zaub

Rotating Zaub
Rotating Zaub
Rotating Zaub
Rotating Zaub
Rotating Zaub
Rotating Zaub

Raspberry pi zaub yog qhov yooj yim heev rau tig vim tias muaj qhov kev xaiv koj tuaj yeem tso rau /boot/config.txt uas tso cai rau koj tig lub vijtsam nrog ib kab.

Txhawm rau tig yooj yim qhib koj lub davhlau ya nyob twg (ctrl + alt + t) thiab tom qab ntawd ntaus "sudo nano /boot/config.txt"

Mus rau hauv qab ntawm cov ntawv thiab ntaus yam uas koj xav tau tig koj lub vijtsam raws li koj xav tau:

# Kev taw qhia tsis raug

display_rotate = 0

# Tig 90 ° Clockwise

display_rotate = 3

# Tig 180 °

display_rotate = 2

# Tig 270 ° Clockwise

display_rotate = 1

Kauj Ruam 2: Vim Li Cas Touchscreen Xav Tau Kev Sib Hloov

Vim li cas Touchscreen Xav Tau Kev Sib Hloov
Vim li cas Touchscreen Xav Tau Kev Sib Hloov
Vim li cas Touchscreen Xav Tau Kev Sib Hloov
Vim li cas Touchscreen Xav Tau Kev Sib Hloov

Lub vijtsam kov me ntsis nyuab dua, nws tso siab rau cov lej kom coj cov tswv yim thiab qhia lawv mus rau txoj haujlwm tshiab. Qhov no tau ua tiav nrog 3 qhov kev hloov pauv hauv qhov sib piv uas muaj ntau heev hauv cov neeg hlau thiab qhov chaw ntawm lub cev los piav qhia qhov txav ntawm qhov khoom hauv qhov chaw 3D. Koj yuav xav tias vim li cas kuv tus 2D cursor xav tau 3D matrix? Tab sis koj tus cursor yeej muaj qhov thib peb qhov uas tsis siv. Saib cov lej hauv qab no:

Los ntawm lub neej ntawd lub matrix tau teeb tsa thiab cim tus lej, lub ntsiab lus ntawm ib-rau-ib daim duab qhia chaw: (Cov dots yog qhov chaw tso los pab kab khoom, xav tias lawv tsis nyob ntawd, Cov ntaub ntawv tshem tawm qhov chaw)

……| 1 0 0 |

Ib = | 0 1 0 |

……| 0 0 1 |

Thaum qhov sib piv no tau sib tw los ntawm cov ntsiab lus vector muab los ntawm koj lub vijtsam kov qhov no yog qhov tshwm sim:

| 1 0 0 |….| 300 |…..| 300 |

| 0 1 0 | * | 200 | = | 200 |

| 0 0 1 |…….| 1 |……….| 1 |

Raws li koj pom saum toj no, tus lej cim tus kheej tsis cuam tshuam rau cov zis. Tam sim no lub hom phiaj ntawm cov lus qhia no tsis yog qhia koj cov lej sib npaug, tab sis yog tias koj txaus siab muaj ntau yam kev qhia online. Kuv yuav qhia tus lej lej ntawm qhov no tsuas yog koj tuaj yeem pom cov pov thawj ntawm yuav ua li cas thiab vim li cas qhov no tshwm sim.

Yog tias peb xav tau tig lub touschscreen 90 ° (clockwise) ces peb yuav siv tus lej no:

| 0 -1 1 |…| 300 |….|-200 |

| 1 0 0 | * | 200 | = | 300 |

| 0 0 1 |……..| 1 |………| 1 |

Yog li koj pom tus lej x thiab y tam sim no tau hloov pauv tab sis tus nqi x tshiab kuj tsis zoo. Nws nyuaj me ntsis kom pom kev, yog li saib kuv qhov piv txwv hauv cov duab. Ib txoj kab yog taug los ntawm nruab nrab mus rau sab xis, tam sim no thaum nws tau tig 90 ° (raws lub moos), koj pom kab ntawv taug mus los ntawm nruab nrab -> sab xis (+x) mus rau qhov nruab nrab -> nqis (-y) thiab qhov no yog vim li cas input vector xav tau hloov pauv xws li. Tus so ntawm kev sib hloov ua ntu zus tau teev tseg hauv cov kauj ruam tom ntej tab sis tam sim no koj paub me ntsis ntxiv txog dab tsi tshwm sim!

Kauj Ruam 3: Tig lub Touchscreen

Tig lub Touchscreen
Tig lub Touchscreen
Tig lub Touchscreen
Tig lub Touchscreen
Tig lub Touchscreen
Tig lub Touchscreen
Tig lub Touchscreen
Tig lub Touchscreen

Mus rau koj lub davhlau ya nyob twg dua thiab ntaus hauv "cd /usr/share/X11/xorg.conf.d/", yog tias koj lub vijtsam kov yam tsawg kawg pom qhov kov ces cov ntawv teeb tsa yuav tsum nyob ntawm no.

Ntaus "ls" txhawm rau sau cov ntaub ntawv tam sim no, koj cov ntaub ntawv ntsuas yuav tsum nyob ntawd, yog tias koj tsis paub qhov twg yog koj li qhib txhua tus (Siv "nano your_file_name") thiab nrhiav ib qho uas muaj ntu uas muaj "Tus cim … touchscreen catchall ". Feem ntau nws yuav yog ib qho uas muaj "evdev" lossis "libinput" hauv lub npe. Thaum koj pom nws ua "sudo nano your_file_name" kom tau txais kev nkag nkag thiab kho cov ntaub ntawv.

Mus rau koj ntu thiab ntxiv qhov raug "Kev Xaiv" hauv qab ntawm "Tshooj".

Txhua tus yog nrog lub zeem muag pom kev:

90 ° = Kev xaiv "TransformationMatrix" "0 -1 11 1 0 0 0 0 0 1"

180 ° = Kev xaiv "TransformationMatrix" "-1 0 1 0 -1 1 0 0 1"

270 ° = Kev xaiv "TransformationMatrix" "0 1 0 -1 0 1 0 0 0 1"

Kauj ruam 4: Nws yog

Vam tias qhov no yuav pab tau ntau pib Raspberry Pi cov neeg txhawb nqa! Kuv pom cov neeg tawm tsam nrog qhov teeb meem no tas li yog tias koj tshwm sim los hla ib tus neeg hauv lub rooj sab laj uas xav tau kev pab tsuas yog xa lawv qhov txuas rau ntawm no. Zoo siab tsim kuv cov phooj ywg!

Pom zoo: