Cov txheej txheem:

Arduino Mouse Control Hnab looj tes: 6 Kauj Ruam (nrog Duab)
Arduino Mouse Control Hnab looj tes: 6 Kauj Ruam (nrog Duab)

Video: Arduino Mouse Control Hnab looj tes: 6 Kauj Ruam (nrog Duab)

Video: Arduino Mouse Control Hnab looj tes: 6 Kauj Ruam (nrog Duab)
Video: මගෙ චන්ඩියාට ඒකාලෙ first time flower bouquet 💐 එකක් දුන්න දවස😂🤪❤️ #sinhala #srilanka #couple 2024, Lub Xya hli ntuj
Anonim
Arduino Mouse Control Hnab looj tes
Arduino Mouse Control Hnab looj tes

Yog li rau kuv txoj haujlwm hauv tsev kawm kuv tau ua lub hnab looj tes Arduino uas tuaj yeem tswj koj tus cursor nrog tus ntsuas hluav taws xob. Hauv ob peb kauj ruam yooj yim Kuv yuav qhia koj tias yuav rov ua cov txheej txheem no li cas.

Kauj ruam 1: Yuav tsum tau ua

Yuav tsum muaj
Yuav tsum muaj

Koj yuav xav tau ob peb yam los ua qhov haujlwm no koj tus kheej:- 1 Arduino Pro Micro- 1 MPU-6050 tus ntsuas cua thiab lub tshuab ntsuas lub ntsej muag- 1 hnab looj tes (nyiam dua ntaub plaub)- Daim kab xev- Mini-USB rau USB cable- Ob peb/kaum os ntawm cov xov tooj - Ib 10k Ohm resistor- Ib lub pob Arduino- Breadboard lossis nyiam dua lub rooj tooj liab

Kauj ruam 2: Code thiab Software

Code thiab Software
Code thiab Software

Ua ntej koj yuav tsum tau teeb tsa Arduino IDE software qhov twg koj yuav sau cov cai. Qhov thib ob, koj yuav tsum rub ob peb lub tsev qiv ntawv uas pab nrog kev sib txuas lus mus rau lub nti: https://github.com/jrowberg/i2cdevlib/tree/master/… Arduino nplaub tshev. Tom qab ntawd peb yuav siv tus lej no ua lub hauv paus: https://www.mrhobbytronics.com/wp-content/uploads/2… Koj tuaj yeem txiav tawm cov kab nrog "buttonstate2" thiab "button 2" tshwj tsis yog tias koj xav ntxiv txoj cai nyem rau qhov ntawd. Qhov ntawd yog txhua yam koj xav tau, tam sim no cia peb tsim lub tsev!

Kauj Ruam 3: Kev thaiv kab hlau

Thaiv
Thaiv

Tam sim no koj muaj hmoo vim tias txoj hlua yog yooj yim zoo nkauj! Peb yuav xav tau tsawg dua kaum lub xov hlau nyob ntawm yog tias koj siv lub khob cij los yog lub rooj tooj liab. Txhawm rau lub zog ntsuas koj yuav xav txuas VCC chaw nres nkoj ntawm Pro Micro mus rau thawj qhov chaw nres nkoj ntawm lub ntsuas tseem hu ua VCC. Tom qab ntawd txuas tus pin hauv av mus rau tus pin thib ob hauv qab VCC ntawm lub sensor. Tom qab ntawd koj yuav tsum tau txais cov ntaub ntawv dhau los yog li koj siv 2 xov hlau ntxiv. Cov no tau txuas nrog cov koob digital (tus lej digital 2 thiab 3). SCL txuas nrog tus pin 3 thiab SDA rau tus pin 2. Tam sim no cia peb txuas lub pob! Koj kuj tseem yuav tsum txuas lub pob rau VCC thiab hauv av ua ntej kom nws tau txais tam sim no. Koj yuav tsum txuas VCC mus rau 10k ohm resistor thiab tom qab ntawd tus tiv thaiv rau khawm. Tom qab ntawd koj yuav tsum txuas nws mus rau tus lej digital (ntawm tus lej 6). Yog tias txhua yam ua haujlwm teeb ntawm lub sensor thiab ntawm Arduino yuav tsum hlawv thaum ntsaws rau hauv USB chaw nres nkoj ntawm koj lub pc.

Kauj Ruam 4: Sib dhos Hnab looj tes

Sib dhos Hnab looj tes
Sib dhos Hnab looj tes

Tam sim no ntawm lub sijhawm no tus kheej nyiam tuaj rau hauv kev ua si. Koj twb muaj txhua yam koj xav tau tab sis tuaj yeem txiav txim siab 3D luam ib lub casing lossis cov hnab looj tes tshwj xeeb. Thaum tsim qauv koj tuaj yeem tsuas yog siv daim kab xev tshwj xeeb los khaws txhua yam hauv qhov chaw. Lub pob yuav tsum tau xaum rau tus ntiv tes xoo nrog lub khawm tig mus rau saum. Koj tuaj yeem kaw kab ib ncig de khawm qhov twg de cables thiab khawm sib ntsib. Koj tseem tuaj yeem khi cov xaim lossis kab xev nws ntau zaus yog tias lawv ntev me ntsis thiab tsis zoo. Tam sim no nrog lub ntsuas nws yog ib qho tseem ceeb heev rau nws txoj cai kom qhov kev tswj hwm ua haujlwm raug. Thaum koj sim nws tawm koj yuav pom txoj hauv kev uas tus cursor txav mus thiab tuaj yeem tsim nyog yog tias tsim nyog. Tab sis kuv xav kom ua nws kom cov ntawv rau tus pin tuaj yeem nyeem thaum koj hnav lub hnab looj tes. Lub sensor yuav tsum mus rau ntawm tus ntiv tes xoo. Xev lub sensor zoo heev thiab tseem khaws cov xov hlau txuas nrog rau tus pin. Tom ntej no koj yuav tsum txuas lub khob cij thiab Arduino rau hnab looj tes lossis rooj plaub uas lawv nyob. Qhov tseem ceeb tshaj plaws ntawm no yog qhov chaw nres nkoj mini-usb yuav tsum tau nqes mus rau hauv qab kom lub cable ntsaws-hauv tsis cuam tshuam ntawm koj cov ntiv tes.

Kauj Ruam 5: Xeem Koj Cov Qauv

Tam sim no sim txhua yam koj xav tau ntsaws rau hauv Arduino Pro Micro siv Mini-usb rau usb cable. Tom qab ntawd khau raj Arduino IDE thiab qhib cov ntawv AccelerometerMouse. Rub cov cai rau arduino thiab ua tiav! Koj yuav tsum pom tus cursor nas txav thaum koj txav lub ntsuas qhov ntsuas ntawm koj tus ntiv tes.

Kauj Ruam 6: Ntxiv

Ntxiv
Ntxiv

Yog tias koj nyiam tus qauv koj tuaj yeem ib txwm ntxiv qee qhov tshwj xeeb. Koj tseem tuaj yeem ntxiv cov ntaub ntawv zoo. Qhov no tuaj yeem ua lasercutted lossis 3D-luam tawm, tsuav yog nws nqa tau ntawm koj lub hnab looj tes. Yog tias koj tau ua tiav txaus koj tseem tuaj yeem ntxiv cov tes taw rau kev ua tshwj xeeb. Qhov muaj peev xwm tsis muaj qhov kawg!

Pom zoo: