Cov txheej txheem:

Wireless PC Joystick/Log Khawm: 4 Kauj Ruam (nrog Duab)
Wireless PC Joystick/Log Khawm: 4 Kauj Ruam (nrog Duab)

Video: Wireless PC Joystick/Log Khawm: 4 Kauj Ruam (nrog Duab)

Video: Wireless PC Joystick/Log Khawm: 4 Kauj Ruam (nrog Duab)
Video: Night 2024, Kaum ib hlis
Anonim
Wireless PC Joystick/Log Khawm
Wireless PC Joystick/Log Khawm

Kuv tau tsim kev sim tshiab sib tw ob peb xyoos dhau los thiab txiav txim siab mus nrog DIY Direct Drive lub kauj tsheb. Thaum qhov haujlwm ntawd ib leeg tuaj yeem yog ob peb cov lus qhia hauv nws tus kheej, qhov no yog kev qhia paub txog kev ua txhua lub khawm ntawm lub log wireless.

Vim li cas?

  • DD lub log muaj kev sib hloov tsis txwv, yog li muaj cov xov hlau mus rau nws yuav ua rau muaj kev ntxhov siab.
  • Tsis muaj peev xwm hla txoj hlua hla ntawm lub log log zoo li hauv cov log tsheb lag luam
  • Kuv xav kom tuaj yeem yooj yim pauv cov log nrog cov khawm sib txawv teeb tsa
  • Vim kuv ua tau:)

Txhawm rau ua tiav lub hom phiaj ntawm cov nyees khawm wireless peb yuav tsum xav txog:

  • Kev xa hluav taws xob
  • Kev Sib Txuas Wireless
  • Lub sijhawm tiv thaiv/ncua
  • Kev ntseeg siab

Cov khoom siv hauv qab no tau xaiv los ua kom tau raws li cov txheej txheem no: Tx - Arduino Nano nrog Kev Sib Koom NRF24 Module ntawm no lossis siv Generic Nano lossis Pro Mini + NRF24 ModuleRx - Arduino Pro Micro / Leonardo / Beetle (Atmega32u4) + NRF24 moduleUSB 'Battery Bank' - Txhua generic tib 18650 roj teeb lub txhab nyiaj yuav tsum ua haujlwm. Qhov no yuav kav ntev txog 20 teev! Tej zaum koj yuav xav kuaj seb nws puas tuaj yeem them nqi thiab xa lub zog rau tib lub sijhawm. Qhov no muaj txiaj ntsig yog tias nws ua haujlwm tiaj tus thiab koj xav them thiab siv tib lub sijhawm.

Ib qho ntxiv koj yuav xav tau cov nyees khawm thiab hloov hluav taws xob ntawm qhov koj xaiv, qee qhov xaim txuas thiab tej zaum muaj qee lub raj cua sov.

Qhov no kuj tseem tuaj yeem siv hauv 'lub npov khawm' hloov ntawm lub log tab sis kuv xav tias yuav muaj qhov xav tau tsawg dua vim tias tsis muaj qhov zoo dua yog tias nws tsis txav mus.

Cov cuab yeej xav tau:

Soldering iron thiab solderAlas yaj phom kub los ua ke rau mounting qhov ib yam nkaus thiab. Arduino IDE ntsia koj lub computer.

Kauj Ruam 1: Tus Xov Tooj Sib Txuas

Cov Xov Tooj Hluav Taws Xob
Cov Xov Tooj Hluav Taws Xob
Cov Xov Tooj Hluav Taws Xob
Cov Xov Tooj Hluav Taws Xob
Cov Xov Tooj Hluav Taws Xob
Cov Xov Tooj Hluav Taws Xob

Pib los ntawm kev teeb tsa ntau qhov hloov pauv raws li koj xav tau ntawm koj lub log thiab txiav txim siab qhov chaw ntawm Arduino. Txuas tag nrho cov xov hlau mus rau qhov hloov pauv raws li daim duab. Txhua lub khawm yuav txuas nrog ib sab rau GND thiab lwm qhov txuas rau tus pin txuas nrog arduino. Txoj cai tso cai rau 14 qhov hloov pauv/khawm uas yuav tsum txaus rau feem ntau lub log.

Yog tias koj siv Nano nrog rau kev kos NRF module, tom qab ntawv pom tseeb koj tsis tas yuav ntxiv cov xov txuas txuas rau qhov ntawd, tsuas yog xaim cov nyees khawm.

Cov nyees khawm nyob hauv qhov kev txiav txim no (1-14): RX, TX, D2, D3, D4, D5, D6, D7, A0, A1, A2, A3, A4, A5

Tab sis vim li cas tsuas yog 14 khawm? lossis cov tswv yim sib piv, qhov no yuav ua rau qee yam qeeb me ntsis. Matrix nyeem ntawv thiab nyeem analog/hloov pauv siv lub sijhawm ua haujlwm. Kuv tsuas xav tau 12 khawm ntawm kuv lub log yog li kuv mus nrog qhov ntawd tab sis yuav txiav txim siab ntxiv.

Rau lub zog, koj muaj ob txoj kev xaiv - Koj tuaj yeem tso tawm lub txhab nyiaj roj teeb hauv lub tswv yim thiab tsuas yog ua kom nws ruaj khov rau lub log. Qhov no muab rau koj ntxiv cov nyiaj tau los ntawm kev tuaj yeem txuas lub zog los ntawm arduino, zam kom tsis txhob muaj qhov hloov pauv hloov thiab qee qhov thaiv.

Yog tias koj xav tau kev daws teeb meem ntau dua, nws yuav tsim nyog txhawm rau qhib lub txhab nyiaj roj teeb thiab rov ua lub hom phiaj sab hauv rau hauv koj li kev teeb tsa.

Kuv tsis muaj chav nyob hauv kuv lub log kom nws tawm mus zoo li nws tau hle tawm. Kuv tshem tus txheej txheem USB txuas los ntawm pawg thawj coj saib xyuas thiab siv lub +5 thiab Gnd xov hlau los ntawm cov chaw nres nkoj usb mus rau Arduino ntawm kev hloov. Nws nyuaj me ntsis kom nthuav dav qhov no vim tias muaj ntau txoj kev xaiv muaj …

Lub Circuit Court tau teeb tsa sab hauv lub log, nthuav tawm lub micro USB them txuas.

Lub rooj tsav xwm them nqi yuav muaj ib lossis ntau lub LEDs los tso saib qhov xwm txheej them nqi - Nws yooj yim los ua kom pom tau li cas lossis siv qee cov yas mus rau 'chaw nres nkoj' lawv mus rau qhov chaw pom kom koj paub thaum nws tau them tas lawm.

Dab tsi yog qhov ntawd?

Kauj ruam 2: Tus Txais

Tus Txais
Tus Txais
Tus Txais
Tus Txais
Tus Txais
Tus Txais

Cias ua raws daim kab xev raws li txuas nrog. Yog tias koj tsis siv Leonardo, koj yuav xav tau tus tswj hwm sab nraud 3.3v xws li AMS1117. Tus tswj hwm Pro Micro tsis tuaj yeem muab tam sim no txaus rau NRF24 Module thiab kab tsis muaj ib qho hlo li.

Kuv muaj xim xim sib txuas rau NRF tus qauv zoo ib yam rau Pro Micro thiab kab.

Arduino 'Beetle' uas yog qhov yooj yim zoo nkauj los nrhiav hauv qhov chaw ib txwm tab sis ib zaug ntxiv, 3.3v tus tswj hwm yuav tsum tau siv vim nws tsis muaj ib qho hlo li. Kuv tau sim qhov no thiab nws ua haujlwm zoo ib yam. Cov kev sib txuas yog tib yam

Kauj Ruam 3: Programming Devices

Programming Devices
Programming Devices
Programming Devices
Programming Devices
Programming Devices
Programming Devices

Yog tias koj tseem tsis tau muaj Arduino IDE teeb tsa lub taub hau mus rau https://www.arduino.cc thiab rub tawm cov ntawv tsim nyog rau koj lub operating system rau qhov piv txwv no kuv nyob ntawm windows.

Thaum teeb tsa, koj yuav xav tau ob lub tsev qiv ntawv sib txawv -Thawj qhov yooj yim ntawm Sketch -> Xws li Tsev Qiv Ntawv -> Tswj Cov Tsev Qiv Ntawv (lossis CTRL+SHIFT+I)

NRFLite los ntawm Dave Parson (version 2.2.2 raws li kev tshaj tawm)

Qhov thib ob yuav tsum tau teeb tsa tus kheej los ntawm

Nyem rau 'Clone lossis Download' ces 'Download ZIP thiab qhib cov ntawv rub tawm. Koj yuav tsum tau nyem dhau mus rau cov ntawv khaws cia kom txog thaum koj pom 'Joystick' nplaub tshev -Luam qhov ntawd rau koj daim ntawv Arduino Libraries (Ntawm lub qhov rais, qhov no feem ntau yog nyob hauv Cov Ntaub Ntawv -> Arduino -> Tsev Qiv Ntawv.

Rov pib dua Arduino IDE

Yog tias koj tab tom siv Pro Micro rau tus txais, koj tseem yuav xav tau ntxiv lub rooj tsav xwm ntawd mus rau IDE. File -> Nyiam -> Ntxiv Tus Thawj Saib Xyuas Haujlwm Ntxiv URLs:

nkag mus:

Tom qab ntawd mus rau Cov Cuab Yeej -> Tus Thawj Saib Xyuas Boards, tshawb Sparkfun thiab nruab 'Sparkfun AVR Boards'

Tam sim no peb tau npaj lawm! Cia pib nrog tus xa tawm - Txuas nws rau koj lub PC

Hauv Cov Cuab Yeej -> Pawg, xaiv 'Arduino Nano' (lossis yam sib txawv uas koj txiav txim siab siv). Kuj txheeb xyuas qhov chaw nres nkoj COM hauv qab cov cuab yeej ntawv qhia zaub mov.

Qhib cov ntawv txuas Wireless_Wheel_Tx.

Tsuas muaj ib kab uas koj yuav xav hloov hauv txoj cai no thiab yog:

int nrfChannel = 22;

Koj muaj txog 126 txoj hauv kev koj tuaj yeem siv hla 2.4Ghz spectrum. Nws yuav tsum raug tso tawm zoo li yog tab sis yog tias koj pom koj muaj teeb meem nrog kev ntseeg tau, tej zaum hloov qhov no mus rau tus lej sib txawv.

Tom qab ntawd tsuas yog ntaus lub pob 'upload' thiab tos kom nws ua tiav.

Tib yam mus rau Leonardo/Pro Micro/Beetle - Xaiv pawg thawj coj koj xav tau - Rau Leonardo thiab Beetle, xaiv Arduino leonardo board. Rau Pro Micro, xaiv qhov ntawd thiab tseem xaiv qhov sib txawv/txheej txheem Atmega32u4 (5v, 16Mhz), qhib Wireless_Wheel_Rx cov ntaub ntawv, hloov qhov chaw tsis muaj chaw (yog tias koj hloov nws ntawm Tx) thiab ua haujlwm tam sim ntawd.

Thaum lub cuab yeej rov pib dua ntawm lub khoos phis tawj, koj lub khoos phis tawj yuav tsum txheeb xyuas lub cuab yeej joystick. Yog tias koj lub zog txhawb koj lub tshuab xa khoom ib yam, koj yuav tsum muaj peev xwm nias lub pob thiab kom nws tshwm sim hauv lub cuab yeej xwm txheej!

Qhov xwm txheej tshwj xeeb txias yog tias koj yuav tau txais lub teeb pom kev zoo ntawm Leonardo thiab Pro Micro - USB TX coj yuav ci thaum nws txuas nrog cov nyees khawm. Txawm li cas los xij, qhov no tsis muaj nyob ntawm kab.

Hloov tshiab 13/2/2021

Kuv tau ntxiv 2 cov ntaub ntawv ntxiv (Tx thiab Rx) rau cov lus qhia ntawm no rau cov ntawv nrog 4 Analog inputs ntxiv rau 3X8 khawm matrix. Feem ntau tsis tau kuaj, tej zaum yuav ncua. Thov sim thiab tawm tswv yim.

Kauj Ruam 4: Kev txhim kho

Kev txhim kho
Kev txhim kho

Fais fab LED Tom qab siv qhov kev daws teeb meem no me ntsis thaum kuv muaj tus cwj pwm uas yuam kev tawm ntawm lub log. Txhawm rau pab tiv qhov no, Kuv tau ntxiv LED rau pem hauv ntej kom kuv pom tau tias lub log tau nyob. Qhov no tsuas yog qhov yooj yim 3mm coj los ntawm 5v ntawm arduino ntawm tus tiv thaiv. Sab saum toj yog xuab zeb txhawm rau nthuav lub teeb me ntsis thiab tiv thaiv qhov muag.

Kuv ntsuas qee lub roj teeb ntsuas los ntawm BG lossis Ali tab sis thaum lawv tuaj txog lawv loj dua qhov kuv xav tau tab sis qhov no yog qee yam kuv tseem xav ntxiv. Muaj ntau txoj kev xaiv muaj rau qhov no tab sis vim tias lub roj teeb nyob ntev li ntawd, Kuv zoo li tsuas yog rov them nyiaj tom qab ob peb teev siv.

Cov nyees khawm ntxiv/encoders/analog inputs Tseem xav txog qhov no. Rau kuv, nws tsis yog qhov tseem ceeb rau kev sib tw kuv ua tab sis rau yam zoo li F1 nws yog qhov muaj txiaj ntsig ntau dua. Kuv yuav txiav txim siab ob tsab ntawv lossis ntxiv qhov no yog tias muaj qhov xav tau txaus tab sis qhov no yuav cuam tshuam lub sijhawm teb ntawm cov nyees khawm.

Pom zoo: