Cov txheej txheem:

Sim Sib Tw Ntaus Pob Box: 8 Kauj Ruam
Sim Sib Tw Ntaus Pob Box: 8 Kauj Ruam

Video: Sim Sib Tw Ntaus Pob Box: 8 Kauj Ruam

Video: Sim Sib Tw Ntaus Pob Box: 8 Kauj Ruam
Video: Tshuaj theem vim li cas thiaj tau nqi ?/ Siv kho mob dab tsi?/paris polyphylla использовать для? 2024, Kaum ib hlis
Anonim
Sim Sib Tw Khawm Box
Sim Sib Tw Khawm Box

Txais tos sim sib tw sib tw!

Puas yog koj tab tom tawm ntawm cov keybinds los qhia tag nrho koj lub tsheb tswj rau? Tej zaum koj xav tau lub npov khawm! Hauv Cov Lus Qhia no peb yuav tsim ib qho los ntawm kos. Lub npov khawm yuav muaj 32 (!) Lub xeev cov khawm. Tsis xav tau software ntxiv los siv lub npov khawm no. Koj yuav kawm paub teeb tsa lub pob matrix thiab sau (lossis theej) cov cai kom xa mus rau koj li Arduino.

Nws yog ib qho tseem ceeb kom paub tias lub npov lub npov tsis txhawb ntau lub khawm nyees khawm ib txhij.

Cia peb pib!

Kauj ruam 1: Kev npaj ua ntej

Kev npaj ua ntej
Kev npaj ua ntej

Koj yuav xav tau qee yam cuab yeej, khawm thiab ntau yam khoom los tsim lub pob khawm. Xav tias dawb los tsim lub npov khawm rau koj qhov kev xav.

Electronics:

  • Nyees khawm
  • Toggles
  • Teb encoders
  • Arduino Pro Micro Cov
  • Mini USB rau USB cable
  • Hlau

Cov Cuab Yeej:

  • Laum
  • Solder
  • Caliper
  • Ntsia Hlau
  • Cutter
  • Ciaj ntswj

Software:

  • Arduino IDE Cov
  • Photoshop/Xim (xaiv tau; tuaj yeem kos los ntawm txhais tes)

Lwm yam:

  • Cov ntaub ntawv kaw (ib lub thawv; tuaj yeem yuav lossis luam tawm 3D luam tawm)
  • Cov yas yas qhwv (xaiv tau)
  • Rotary encoder pob qhov rooj
  • Hloov npog (yeem)
  • Label tshuab luam ntawv (yeem)
  • Roj hmab grommet

Thaum koj muaj tag nrho (lossis txaus los pib) cov khoom peb tuaj yeem pib tsim cov txheej txheem ntawm lub npov pob.

Kauj Ruam 2: Tsim Lub Txheej Txheem Box

Cov cuab yeej xav tau rau theem no:

Photoshop/Xim (xaiv tau; tuaj yeem kos los ntawm txhais tes)

Tus tsim ntawm lub npov khawm tuaj yeem sib txawv rau txhua tus. Txawm li cas los xij, rau Cov Lus Qhia no peb yuav siv cov txheej txheem uas suav nrog:

  • 4x peb txoj kev toggle keyboards
  • 2x ib txoj kev toggle keyboards
  • 10x yooj yim laub khawm
  • 4x rotary encoder nrog khawm yooj yim

Peb txoj kev toggle keyboards:

Muaj ntau hom toggle keyboards. Qee qhov yog ib ntus thiab qee qhov nyob hauv qhov chaw kom txog thaum rov qab los. Nws nyob ntawm koj uas yuav siv hom twg, tab sis kuv qhia siv qhov hloov pauv ib ntus raws li lub npov khawm no tsis muaj peev xwm muaj ntau lub khawm sib txuam ua haujlwm tib lub sijhawm. Txij li cov toggle hloov pauv yog peb txoj kev (rau/tawm/rau), peb muaj yim (4x2) khawm muaj.

Ib txoj kev toggle keyboards:

Cov no tuaj yeem suav tias yog cov nyees khawm yooj yim (tawm/rau). Cov no tseem tuaj yeem hloov pauv ib ntus lossis hloov pauv. Ib zaug ntxiv, txog tus kheej nyiam uas xaiv. Cov no muab peb ob (2) khawm uas muaj.

Cov nyees khawm yooj yim:

Khawm zoo li no tuaj yeem siv los ntawm kev thawb lawv (tawm/rau). Cov no yuav muab peb kaum (10) khawm.

Rotary encoders nrog khawm yooj yim:

Feem ntau (yog tsis yog txhua qhov) cov lej nkag teb tuaj yeem tig mus rau ob qho kev qhia tsis kawg. Txhua lub sijhawm koj tig lawv mus rau qhov kev qhia nws tau siv ua lub pob nyem. Cov encoders teb no tseem tuaj yeem nias muab lwm lub pob rau lawv. Cov encoders teb muab kaum ob (12 = 4x3; tig sab laug/tig sab xis/thawb) cov nyees khawm.

32 nyees khawm:

Muaj lawv txhua tus ua ke muab rau peb 32 (8+2+10+12) khawm nias!

Txaus siab rau qhov txheej txheem? Lub sijhawm los pib tsim!

Kauj Ruam 3: Ntsuas thiab Laum

Ntsuas thiab Laum
Ntsuas thiab Laum
Ntsuas thiab Laum
Ntsuas thiab Laum

Cov cuab yeej xav tau rau theem no:

  • Caliper
  • Laum
  • Electronics (cov nyees khawm, hloov pauv, thiab lwm yam)

Ntsuas tag nrho cov nyees khawm uas koj xav ntxiv rau koj lub npov khawm. Yog tias koj muaj teeb meem nrhiav qhov ntev ntawm koj cov khoom siv hluav taws xob, siv lub (digital) caliper kom tau txais txoj kab uas hla ntawm lawv.

Kos rau qhov chaw nruab nrab ntawm cov khoom siv hluav taws xob ntawm lub ntsej muag ntawm koj lub thaiv thiab laum qhov nrog qhov ntau thiab tsawg. Nrhiav kom ua lub thaiv me ntsis kom zoo nkauj zoo nkauj dua? Tos nrog haum cov nyees khawm!

Thaum koj ua tiav qhov drilling peb tuaj yeem ua rau nws pib zoo li lub npov khawm tiag!

Kauj Ruam 4: Haum Lub Nyees khawm, Rotaries thiab Toggles

Haum lub Nyees khawm, Teb thiab Toggles
Haum lub Nyees khawm, Teb thiab Toggles
Haum lub Nyees khawm, Teb thiab Toggles
Haum lub Nyees khawm, Teb thiab Toggles

Cov cuab yeej xav tau rau theem no:

  • Electronics (cov nyees khawm, hloov pauv, thiab lwm yam)
  • Ciaj ntswj
  • Cov yas yas qhwv (xaiv tau)
  • Cutter (yeem)

Txhua yam ntawm koj cov khoom siv hluav taws xob yuav tsum tuaj nrog txiv ntseej los ntsaws rau hauv qhov chaw. Yog tsis yog; ntsuas lawv thiab yuav cov txiv ntoo loj kom raug.

Koj yuav tsum xav txhim kho (tus kheej lub tswv yim) saib ntawm koj lub npov khawm koj tuaj yeem siv cov roj carbon fiber yas yas qhwv. Txiav nws kom loj (thiab loj dua me ntsis) ntawm koj lub ntsej muag lub ntsej muag uas koj tau tho qhov. Siv cov yas thiab qhwv nws ib ncig ntawm cov ces kaum rau tom qab. Qhov no yuav ua kom ntseeg tau tias cov ntaub qhwv nyob hauv qhov chaw thaum lub thawv kaw. Cov yas yas ntau dhau uas tam sim no thaiv lub qhov tuaj yeem raug tshem tawm siv lub tshuab txiav.

Tau muab tso rau hauv qhwv (lossis tsis yog) koj tuaj yeem haum hauv cov khoom siv hluav taws xob los tsim ua ntej ntawm koj lub npov khawm. Tam sim no koj yuav tsum muaj qee yam uas zoo li ib yam lawm! Tu siab, nws tseem tsis tau ua haujlwm …

Kauj Ruam 5: Tsim Tus Qauv Teeb

Tsim Cov Qauv Hluav Taws Xob
Tsim Cov Qauv Hluav Taws Xob

Cov cuab yeej xav tau rau theem no:

Photoshop/Xim (xaiv tau; tuaj yeem kos los ntawm txhais tes)

Tsim ib qho matrix:

Kev siv tus lej yuav txuag peb lub sijhawm thiab ntau qhov tsis tsim nyog txuas thiab txuas. Kuv yuav tsis mus rau ntau yam ntxaws ntxaws rau kuv tus kheej, tab sis yuav qhia tias koj ua tib zoo saib ntawm kab ntawv no yog tias koj tsis nkag siab nrog lub tswv yim ntawm cov lej.

Tsim koj tus kheej cov lej lossis siv cov txheej txheem los ntawm Cov Lus Qhia no. Hauv matrix peb yuav siv tsib pab pawg. Cov pab pawg tau txuas nrog cov pinouts hauv qab no ntawm Arduino:

  • 15: plaub tus encoders teb
  • A0: tsib lub laub khawm
  • A1: ob peb txoj kev toggles thiab ib lub laub khawm
  • A2: ob peb txoj kev toggles thiab ib lub laub khawm
  • A3: tsib lub laub khawm

Kauj ruam 6: Soldering

Soldering
Soldering
Soldering
Soldering

Cov cuab yeej xav tau rau theem no:

  • Soldering hlau
  • Solder
  • Electronics (ntsia ntawm koj lub thaiv)
  • Arduino Pro Micro Cov
  • Hlau

Yeem:

Tshaj tawm cov cai los ntawm cov kauj ruam tom ntej ua ntej yog tias koj txhawj xeeb txog kev siv tshuaj yaj yeeb. Qhov no yuav tso cai rau koj los tshuaj xyuas koj cov kev sib txuas

Peb xav thov siv tus lej uas tau tsim hauv cov kauj ruam dhau los rau lub npov khawm tiag. Siv qee lub sijhawm rau qhov no, tshwj xeeb tshaj yog tias qhov no yog koj thawj zaug soldering.

Qee cov lus qhia:

  • Ua ib pab pawg thaum lub sijhawm
  • Txuas Arduino rau koj lub khoos phis tawj txhawm rau sim qee zaum
  • Tsis txhob ua kom sov cov yas khawm ntau dhau vim tias lawv tuaj yeem yaj thiab rhuav kev sib txuas
  • Tsis txhob siv cov laug ntau dhau, tsawg dua yog qhov zoo dua
  • Siv cov xov hlau sib txawv rau txhua pab pawg/hauv av

Kauj Ruam 7: Sau Txoj Cai

Cov cuab yeej xav tau rau theem no:

  • Arduino IDE Cov
  • Lub tsev qiv ntawv Joystick
  • Keypad.h (Arduino IDE> Sketch> suav nrog Tsev Qiv Ntawv> Tswj Tsev Qiv Ntawv …> Tshawb nrhiav Keypad thiab teeb tsa ib qho uas tau tsim los ntawm Mark Stanley thiab Alexander Brevig)

#ncig #ncig

#define ENABLE_PULLUPS

#define NUMROTARIES 4 #define NUMBUTTONS 24 #define NUMROWS 5 #define NUMCOLS 5

byte nyees khawm [NUMROWS] [NUMCOLS] = {

{0, 1, 2, 3, 4}, {5, 6, 7, 8, 9}, {10, 11, 12, 13, 14}, {15, 16, 17, 18, 19}, {20, 21, 22, 23}, };

struct rotariesdef {

byte pin 1; byte pin 2; koj ccwchar; koj cwchar; lub xeev tsis hloov pauv uas tsis tau kos npe; };

rotariesdef rotaries [NUMROTARIES] {

{0, 1, 24, 25, 0}, {2, 3, 26, 27, 0}, {4, 5, 28, 29, 0}, {6, 7, 30, 31, 0}, };

#txhais DIR_CCW 0x10

#define DIR_CW 0x20 #define R_START 0x0

#ifdef HALF_STEP

#define R_CCW_BEGIN 0x1 #define R_CW_BEGIN 0x2 #define R_START_M 0x3 #define R_CW_BEGIN_M 0x4 #define R_CCW_BEGIN_M 0x5 const unsigned char ttable [6] [4] = {// R_START (00) {R_START_M, R_CW_BEGIN} R_CCW_BEGIN {R_START_M | DIR_CCW, R_START, R_CCW_BEGIN, R_START}, // R_CW_BEGIN {R_START_M | DIR_CW, R_CW_BEGIN, R_START, R_START}, // R_START_M (11) {R_START_M, R_CCW_BEGIN_M, R_CW_BEGIN_M, R_START}, // R_CW_BEGIN_M {R_START_M, R_START_M, R_CW_BEGIN_M, R_START | DIR_CW}, // R_CCW_BEGIN_M {R_START_M, R_CCW_BEGIN_M, R_START_M, R_START | DIR_CCW},}; #else #define R_CW_FINAL 0x1 #define R_CW_BEGIN 0x2 #define R_CW_NEXT 0x3 #define R_CCW_BEGIN 0x4 #define R_CCW_FINAL 0x5 #define R_CCW_NEXT 0x6

const unsigned char ttable [7] [4] = {

// R_START {R_START, R_CW_BEGIN, R_CCW_BEGIN, R_START}, // R_CW_FINAL {R_CW_NEXT, R_START, R_CW_FINAL, R_START | DIR_CW}, // R_CW_BEGIN {R_CW_NEXT, R_CW_BEGIN, R_START, R_START}, // R_CW_NEXT {R_CW_NEXT, R_CW_BEGIN, R_CW_FINAL, R_START}, // R_CCW_BEGIN {R_CCW_NEXT, R_ST_RCC, R_ST_REX_REX, R_ST_NEXT, R_ST_NEXT, R_ST_NEXT, R_ST_NEXT, R_STW_REX, R_START, R_STWR, R_START, R_START | DIR_CCW}, // R_CCW_NEXT {R_CCW_NEXT, R_CCW_FINAL, R_CCW_BEGIN, R_START},}; #ib

byte rowPins [NUMROWS] = {21, 20, 19, 18, 15};

byte colPins [NUMCOLS] = {14, 16, 10, 9, 8};

Keypad buttbx = Keypad (uaKeymap (cov nyees khawm), rowPins, colPins, NUMROWS, NUMCOLS);

Joystick_ Joystick (JOYSTICK_DEFAULT_REPORT_ID, JOYSTICK_TYPE_JOYSTICK, 32, 0, cuav, cuav, cuav, cuav, cuav, cuav, cuav, cuav, cuav, cuav, cuav, cuav);

void teeb tsa () {

Joystick.begin (); teb_init ();}

void voj () {

CheckAllEncoders ();

CheckAllButtons ();

}

void CheckAllButtons (tsis muaj dab tsi) {

yog (buttbx.getKeys ()) {rau (int i = 0; i

void rotary_init () {

rau (int i = 0; i

unsigned char rotary_process (int _i) {

unsigned char pinstate = (digitalRead (rotaries [_i].pin2) << 1) | digitalRead (teb [_i].pin1); teb [_i].state = ttable [rotaries [_i].state & 0xf] [pinstate]; rov qab (tig [_i].state & 0x30); }

void CheckAllEncoders (void) {rau (int i = 0; kuv <NUMROTARIES; i ++) {

unsigned char result = rotary_process (kuv); yog (qhov tshwm sim == DIR_CCW) {Joystick.setButton (tig .ccwchar, 1); ncua (50); Joystick.setButton (teb [kuv].ccwchar, 0); }; yog (qhov tshwm sim == DIR_CW) {Joystick.setButton (tig .cwchar, 1); ncua (50); Joystick.setButton (teb [kuv].cwchar, 0); }; }}

  1. Txuas koj Arduino Pro Micro rau koj lub computer los ntawm ntsaws rau hauv USB cable
  2. Txhawm rau upload cov cai xaiv hom Arduino los ntawm kev mus rau Cov Cuab Yeej> Pawg: …> Arduino/Genuino Micro.
  3. Txhawm rau xaiv qhov tseeb USB chaw nres nkoj mus rau Cov Cuab Yeej> Port:> COM x (Arduino/Genuino Micro)
  4. Txheeb xyuas qhov kos duab los ntawm txhaj rau ✓ nyob rau saum kaum sab laug (hauv Cov Ntaub Ntawv)
  5. Nias lub → ib sab ntawm nws txhawm rau rub nws mus rau Arduino

Kauj Ruam 8: Ntxiv rau Koj Rig

Ntxiv rau Koj Rig
Ntxiv rau Koj Rig

Nrog koj zoo siab! Koj tau tuaj txog deb. Tam sim no nws yog lub sijhawm los sib tw!

Pom zoo: