Cov txheej txheem:
- Kauj Ruam 1: Sau Cov Khoom
- Kauj Ruam 2: Ua Kom Paub Zoo nrog Joystick Pins
- Kauj Ruam 3: Txuas Txhua Yam Ua Ke
- Kauj Ruam 4: Sau Txoj Cai
- Kauj Ruam 5: Saib Xyuas Kev Ua
Video: Joystick Sensor: 6 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Lub joystick sensor tau siv rau ntau hom kev ua haujlwm ntawm cov neeg hlau arduino tab sis nws feem ntau siv rau kev tswj cov vis dis aus game lossis txhua hom kev tswj hwm uas cuam tshuam nrog joystick.
Joystick muaj lub hau yas tshem tau uas koj so koj cov ntiv tes thaum siv. Thaum tshem lub hau no koj muaj qhov pom tau zoo dua ntawm tus pin, lub laub khawm thiab lub ntsuas pa. Analog joysticks yog lub hauv paus muaj zog yog li lawv rov qab qhov txiaj ntsig zoo. Ob lub npog dub nyob rau sab yog lub tsev sensor. Lub sensor ntawm sab laug yog rau nce thiab nqis txav, thaum txav tus pas nce thiab nqis dab tsi uas tau tshwm sim tiag tiag yog tias cov yas sab hauv tau los sib chwv nrog sab sensor paub yog tias tus pas tau txav mus lossis nqis qhov no yog y-axis sensor. Lub sensor nyob ntawm qhov deb tshaj ntawm tus joystick yog hnov qhov txav mus rau sab laug thiab sab xis uas yog x-axis. Cov ntsuas no tau xa cov lus sib piv tab sis tus joystick tseem muaj lub laub khawm lossis hloov pauv, thaum thawb rau ntawm tus joystick qhov hloov pauv sab hauv tau raug thawb xa xa cov digital. Txij li thaum peb paub yuav ua li cas lub joystick sensor ua haujlwm cia peb txuas nws mus rau Arduino thiab saib nws ua haujlwm li cas.
Kauj Ruam 1: Sau Cov Khoom
-Arduino Ib
-Joystick Sensor
-Female/Txiv neej Jumper Cables
-USB 2.0 Cable Hom A/B.
-Computer
-Arduino IDE
Kauj Ruam 2: Ua Kom Paub Zoo nrog Joystick Pins
Tus joystick muaj tsib tus pin, GND, 5V, VRx. VR thiab SW. Thaum txuas qee yam rau lub zog koj yuav tsum ib txwm muaj qhov tsis zoo thiab qhov zoo uas sib thooj rau qhov tsis zoo thiab sab zoo ntawm koj lub zog. Hauv qhov no tus lej cim npe GND sawv rau "Hauv av" thiab qhov no yog peb tus lej tsis zoo ntawm tus joystick. 5V sawv rau "5 Volts" thiab qhov no yog peb tus pin zoo, ob qho tib si ntawm cov pins no yog peb lub hwj chim txuas. Tom ntej no, VRx yog peb tus kab rov tav lossis x-axis tus pin thiab qhov no yog tus pin analog uas txuas rau sab sib piv ntawm arduino, tib yam nrog VRy tus pin uas yog peb kab ntsug y-axis pins. Ob qho ntawm cov pins no yog tus pin taw qhia yog li thaum lub joystick txav cov pins tab tom tso tawm cov teeb liab analog. Peb tus pin kawg yog SW tus pin uas sawv rau "Hloov" tus pin no txuas nrog lub laub khawm thiab thaum nws raug thawb tus pin tso tawm lub teeb liab.
Kauj Ruam 3: Txuas Txhua Yam Ua Ke
Tam sim no nws yog lub sijhawm los ua peb qhov kev sim ua!
Ua ntej tshaj, txuas koj tus poj niam sab ntawm lub jumper cables rau lub joystick pins uas yuav tsum yog tsib nyob rau hauv tag nrho.
Qhov thib ob, txuas tus txiv neej sab ntawm lub jumper cables mus rau tus lej sib xws ntawm koj li arduino. GND rau GND, 5V txog 5V, VRx thiab VRy rau txhua tus pin sib piv ntawm arduino tab sis qhov no peb cov cai qhia peb kom muab cov no rau A0 thiab A1. Tus pin kawg peb xav tau txuas rau lossis arduino yog peb tus pin SW uas yuav mus rau sab digital ntawm arduino yog li ntawd yuav txuas nrog digital pin 2.
Thib peb, txuas koj lub USB cable mus rau arduino thiab nkag rau hauv computer.
Kauj Ruam 4: Sau Txoj Cai
Tam sim no peb muaj txhua yam txuas nrog peb pawg thawj coj saib arduino nws yog lub sijhawm los rub cov cai kom raug. Brainy Bits muaj cov lej sau lawm rau peb yog li peb tsuas tuaj yeem luam thiab muab lo rau hauv peb Arduino IDE.
Txuas mus rau Code:
1. Qhib daim ntawv arduino IDE tshiab
2. Muab cov cai
3. Ua kom tiav
Kauj Ruam 5: Saib Xyuas Kev Ua
Nyem rau ntawm lub iav tsom iav uas nyob ntawm kaum sab xis saum toj ntawm lub vijtsam. Lub qhov rai tshiab yuav tsum tshwm thiab qhov koj pom yog qhov ua tau thaum txav koj lub joystick. Mus tom ntej thiab txav ncig koj lub joystick thiab x thiab y axis yuav tsum hloov pauv nyob ntawm txoj haujlwm koj joystick nyob ntawm. Sim nias ntawm koj tus joystick thiab koj tus SW tus pin yuav tsum hloov ntawm 1 txog 0. Thaum tus joystick nyob ntawm qhov chaw nruab nrab koj tus x-axis yuav tsum yog ntawm 513 thiab koj y-axis yuav tsum yog ntawm 522. Dab tsi tshwm sim hauv txoj cai yog tias lub voj void yog luam tawm lub joystick txoj haujlwm siv lub teeb liab analog thiab thaum lub pob nyem nrog lub teeb liab.
Pom zoo:
Arduino Tsheb Rov Qab Chaw Nres Tsheb Ceeb Toom - Cov Kauj Ruam ntawm Kauj Ruam: 4 Kauj Ruam
Arduino Tsheb Rov Qab Chaw Nres Tsheb Ceeb Toom | Cov kauj ruam ib kauj ruam: Hauv txoj haujlwm no, kuv yuav tsim qhov yooj yim Arduino Tsheb Rov Qab Tsheb Nres Tsheb Nres Sensor Siv Arduino UNO thiab HC-SR04 Ultrasonic Sensor. Qhov no Arduino raws Lub Tsheb Rov Qab ceeb toom tuaj yeem siv rau Kev Tshawb Fawb Txog Tus Kheej, Robot Ranging thiab lwm yam
Tsev Automation Kauj Ruam ntawm Kauj Ruam Siv Wemos D1 Mini Nrog PCB Tsim: 4 Kauj Ruam
Tsev Automation Kauj Ruam Ib Leeg Siv Wemos D1 Mini Nrog PCB Tsim: Tsev Automation Kauj Ruam los ntawm Kauj Ruam siv Wemos D1 Mini nrog PCB Tsim cov tub ntxhais kawm ntawv qib siab. Tom qab ntawd ib tus ntawm peb cov tswv cuab tuaj
RC Taug Qab Neeg Hlau Siv Arduino - Kauj Ruam Ib kauj ruam: 3 Kauj Ruam
RC Tracked Robot Siv Arduino - Kauj Ruam Ib Nrab: Hav guys, Kuv rov qab los nrog lwm tus neeg hlau txias chassis los ntawm BangGood. Vam tias koj tau dhau los ntawm peb cov phiaj xwm yav dhau los - Spinel Crux V1 - Tus Cwj Pwm Tswj Tus Neeg Hlau, Spinel Crux L2 - Arduino Xaiv thiab Muab Neeg Hlau nrog Robotic caj npab thiab Badland Braw
Kawm Yuav Ua Li Cas Kos Tus Tswm Ciab - Kauj Ruam Ib Kauj Ruam: 6 Kauj Ruam
Kawm Yuav Ua Li Cas Thiaj Li Tswmciab - Kauj Ruam Ib kauj ruam: Cov tswm ciab no siv sijhawm 10 feeb los kos yog tias koj ua raws kuv cov kauj ruam ua tib zoo
DIY Arduino Robotic Arm, Kauj Ruam ntawm Kauj Ruam: 9 Kauj Ruam
DIY Arduino Robotic Arm, Kauj Ruam ntawm Kauj Ruam: Cov ntawv qhia no yog qhia koj yuav tsim lub Caj Npab Caj Npab ntawm koj tus kheej li cas