Cov txheej txheem:
- Kauj Ruam 1: Solder Pin Headers rau Arduino Qhov Ntxiv I/O Ports
- Kauj Ruam 2: Ntxiv Arduino Joystick Library rau Koj IDE
- Kauj Ruam 3: Nyem Txoj Cai Rau Arduino
- Kauj Ruam 4: Ua Kev Txuas Hluav Taws Xob
- Kauj Ruam 5: Txheeb Tus Neeg Txais
- Kauj Ruam 6: Kho Txoj Cai rau Koj Li Cas
- Kauj Ruam 7: Calibrate Emulated Joystick
Video: R/C rau USB Choj: 7 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Hloov PPM cov cim los ntawm lub mloog xov tooj cua rau hauv txoj haujlwm joystick
Siv nws los ua si koj nyiam kev ua si thiab simulators dav hlau nrog koj R/C lub xov tooj cua xa xov. Cov lus qhia no siv Arduino los ntawm littleBits thiab tus txais DSMX ntxiv rau cov lej yooj yim ua kom hloov pauv no.
Koj yuav xav tau
- Fais fab
- Arduino
- USB kab
- tus pin headers
- jumper hlau
- lub xov tooj cua txais nrog PPM tso tawm.
Kauj Ruam 1: Solder Pin Headers rau Arduino Qhov Ntxiv I/O Ports
Txhawm rau ua kom lub zog txais (RX), tus pin headers yuav tsum tau ntxiv rau Arduino. Qhov no tseem yuav ua rau cov hlua ntawm Bit thiab RX yooj yim dua. Saib https://discuss.littlebits.cc/t/using-the-additional-i-os-on-the-arduino-bit yog xav paub ntxiv.
Kauj Ruam 2: Ntxiv Arduino Joystick Library rau Koj IDE
Koj tuaj yeem nrhiav lub tsev qiv ntawv ntawm GitHub, https://github.com/MHeironimus/ArduinoJoystickLib… Ua tsaug, Matthew Heironimus, rau kev sau nws.
Tsuas yog qee tus Arduinos tuaj yeem ua raws li HID zoo li lub joystick. Raws li lub LittleBits microcontroller yog Arduino Leonardo ntawm lub siab koj zoo mus.
Kauj Ruam 3: Nyem Txoj Cai Rau Arduino
#include #define inputPin 16#txhais raws 4 #def lo lo 800 // kho rau cov zis ntawm RX#txhais tau zoo 1600 // kho kom raug rau RX#txhais cov lim 10int channel [raws]; int yav dhau losValue [raws]; int counter = 0; Joystick_ Joystick (JOYSTICK_DEFAULT_REPORT_ID, JOYSTICK_TYPE_MULTI_AXIS, 0, 0, tseeb, tseeb, cuav, cuav, cuav, tseeb, cuav, cuav, cuav); void setup () {Joystick.setXAxisRange (lo, hais); Joystick.setYAxisRange (lo, nyob zoo); Joystick.setThrottleRange (lo, nyob zoo); Joystick.setRudderRange (lo, nyob zoo); Joystick.begin (); Serial.begin (9600); pinMode (inputPin, INPUT); } void loop () {if (pulseIn (inputPin, HIGH)> 3000) {rau (int i = 0; i <= channels-1; i ++) {channel = pulseIn (inputPin, HIGH); } rau (int i = 0; i <= channels-1; i ++) {if ((channel > 2000) || (channel <500)) {channel = previousValue ; } lwm tus {channel = (yav dhau los Tus nqi +channel )/2; txee ++; }} Joystick.setXAxis (channel [0]); Joystick.setYAxis (channel [1]); Joystick.setThrottle (channel [2]); Joystick.setRudder (channel [3]); } yog (counter> lim) {rau (int i = 0; i <= channels-1; i ++) {Serial.print ("channel"); Serial.print (kuv+1); Serial.print (":"); Serial.println (channel [kuv]); yav dhau losValue = channel ; } suav = 0; }}
Thov nco ntsoov tias cov cai uas txuas nruab nrab ntawm R/C teeb liab thiab emulated USB HID los hauv nws daim ntawv yooj yim tshaj plaws. Lub luag haujlwm siv ntawm no - pulseIn - yog qhov ua haujlwm thaiv. Nyeem ntawm no, thiab ntawm no, yuav ua li cas siv txoj hauv kev tsis thaiv kev siv kev cuam tshuam.
Kauj Ruam 4: Ua Kev Txuas Hluav Taws Xob
Txuas jumper hlau / DuPont cables ntawm Bit thiab RX. Cov txuas ntawm qhov kawg ntawm cov kab no yuav tsum yog poj niam. Peb txuas GND (xiav), VCC (xim av) thiab teeb liab (txiv kab ntxwv) los ntawm PPM chaw nres nkoj ntawm RX rau GND, VCC thiab d16 ntawm Arduino.
Kauj Ruam 5: Txheeb Tus Neeg Txais
Tshem tawm Arduino los ntawm lub zog. Muab cov hlua khi rau hauv qhov chaw txuas uas cim BIND ntawm RX. Qhib koj lub xov tooj cua xa xov thiab hloov nws mus rau hauv hom khi. Tom ntej no thov lub zog rau Arduino. Cov txheej txheem khi tau ua tiav thaum LED hauv lub txais tau qhib.
Kauj Ruam 6: Kho Txoj Cai rau Koj Li Cas
Qhov nyob zoo thiab lo hauv Arduino kos duab yuav tsum tau hloov kho kom pom qhov tseeb ntawm cov neeg txais uas koj siv.
#define li 800
#define nyob zoo 1600
Cov cim qhia hauv PPM mem tes zoo li ntawm 1000μs txog 2000μs. RX siv hauv Cov Lus Qhia Qhia Tawm qhov txiaj ntsig kwv yees li ntawm 800 thiab 1600 thiab txawv me ntsis ntawm txhua cov channel. Txhawm rau nrhiav seb qhov twg koj tus neeg txais khoom muaj, qhib Serial Monitor hauv Arduino IDE kom pom qhov tso tawm ntawm koj RX. Nws yuav zoo li qhov no:
tshooj 1: 728
channel 2: 729 channel 3: 703 channel 4: 726 channel 1: 1681 channel 2: 1639 channel 3: 1613 channel 4: 1676
Thaum koj muaj lub tswv yim pom tseeb ntawm qhov ntau uas koj RX tso tawm, xaiv qhov kev kwv yees zoo rau nyob zoo thiab lo thiab hloov qhov tsis sib xws raws li. Tom qab ntawd xa cov duab kos mus rau Arduino dua.
Kauj Ruam 7: Calibrate Emulated Joystick
Nqa tus ntaus ntawv mus rau koj lub khoos phis tawj thiab siv qhov ntsuas qhov ua haujlwm ntawm koj li OS txhawm rau ntsuas qhov ntsuas tus lej. Ib qho cuab yeej zoo rau Linux yog jstest-gtk.
Kev txhim kho ntxiv
- Sau cov cai tsis txwv (saib Kauj Ruam 3)
- Teeb cov kab ib channel, tsis yog thoob ntiaj teb (saib Kauj Ruam 6)
Nyeem ntxiv
- Redcon CM703
- PPM
Pom zoo:
Pheej Yig NMEA/AIS Hub - RS232 rau Wifi Choj rau Onboard Siv: 6 Kauj Ruam
Pheej Yig NMEA /AIS Hub - RS232 rau Wifi Choj rau Onboard Siv: Hloov Kho Lub Ib Hlis Tim 9 Lub Ib Hlis 2021 - Ntxiv TCP kev txuas ntxiv thiab rov siv qhov kawg txuas yog tias muaj cov neeg siv txuas ntau dua Hloov kho lub Kaum Ob Hlis 13, 2020 - Ntxiv tsis muaj teeb tsa tus qauv ntawm cov nkoj rau cov routers uas twb muaj lawm AIS RS232 rau WiFi choj yog
Raspberry Pi Ethernet rau Wifi Choj: 7 Kauj Ruam
Raspberry Pi Ethernet rau Wifi Choj: Kuv muaj kev sim network ntawm ntau yam Raspberry Pies, khoom siv, thiab lwm lub khoos phis tawj thiab cov khoom siv sib txuas, lawv txhua tus tau tswj hwm los ntawm Ubiquity firewall/router thiab kuv xav kom nws txuas nrog internet yog li kuv tuaj yeem rub tawm tshiab, software, thiab lwm yam
Siv Pulsed Solenoids Nrog Wemos D1 Mini thiab H-Choj rau Dej: 7 Kauj Ruam
Siv Pulsed Solenoids Nrog Wemos D1 Mini thiab H-Choj rau Kev Tso Dej: Rau cov lus qhia no kuv xav tsim kev daws teeb meem yog li kuv tuaj yeem txav mus deb ntawm lub tshuab txau dej lossis kom pib ywg dej kuv cov yub. Kuv yuav siv wemos D1 los tswj pulsed solenoids. Cov solenoids no siv lub zog tsawg dua vim tias thaum lawv tau txais
Yooj Yim WiFi rau BLE (Bluetooth Tsawg Zog) Choj: 9 Kauj Ruam (nrog Duab)
Yooj Yim WiFi rau BLE (Bluetooth Tsawg Zog) Choj: Hloov kho lub Kaum Ob Hlis 4, 2017 - hloov kho Feather nRF52 cov duab kos thiab cov lus qhia daws teeb meem. Ntxiv cov duab ntawm tus choj txuas rau hauv lub thawv Qhov haujlwm yooj yim no muab WiFi nkag mus rau ib qho Bluetooth Tsawg Zog (BLE) tus qauv uas ua haujlwm Nordic's UART nrog TX Qhia. Th
Txaus Siab Rau Koj Tus Kheej Tsuas Yog Siv 12V-rau-AC-kab Inverter rau LED Lub Teeb Hluav Taws Xob Tsis txhob Rov Ua Rau Lawv rau 12V.: 3 Cov Kauj Ruam
Txaus Siab Rau Koj Tus Kheej Tsuas Yog Siv 12V-rau-AC-kab Inverter rau LED Lub Teeb Hluav Taws Xob Tsis txhob Rewiring Lawv rau 12V: Kuv txoj kev npaj tau yooj yim. Kuv xav txiav cov phab ntsa uas siv hluav taws xob LED teeb ua ib daim ces rov txuas nws kom khiav tawm 12 volts. Lwm txoj hauv kev yog siv lub zog hloov pauv, tab sis peb txhua tus paub tias lawv tsis muaj txiaj ntsig zoo, puas yog? Txoj cai? Los yog lawv?