Cov txheej txheem:
- Kauj ruam 1: Rub cov software uas cuam tshuam rau koj lub khoos phis tawj
- Kauj ruam 2: Kho vajtse
- Kauj Ruam 3: Muab Tsheb kauj vab tso rau ntawm Lub Caij Tsheb Caij Tsheb
- Kauj Ruam 4: Upload thiab Xeem Arduino Code
- Kauj Ruam 5: Teeb YouTube Tus Tswj
Video: Tsheb kauj vab Simulator Nrog Kev Hloov Sijhawm Ceev: 5 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Txoj haujlwm no siv lub tshuab nqus hlau sib nqus los tsim lub ntsuas cua nrawm thiab tswj cov vis dis aus nrawm ntawm thawj tus neeg caij tsheb kauj vab yeeb yaj kiab hauv YouTube lossis lwm yam xov xwm. Arduino suav mph thiab tom qab ntawd siv cov ntaub ntawv ntawd los sim ua lub computer khawm nias. Lub pob nyem no, ua ke nrog Google Chrome txuas ntxiv, ua kom nrawm dua lossis qeeb cov vis dis aus raws li kev hloov pauv nrawm. Nws muaj cov txheej txheem kho vajtse yooj yim uas cov uas tau pib rau Arduino tuaj yeem tsim tau yooj yim ntawm lawv tus kheej.
Tus lej ntsuas qhov nrawm yog ua raws txoj haujlwm no:
Cov Khoom Kho Mob:
1. Arduino Leonardo
2. Micro USB Cable (Yuav tsum muaj peev xwm xa cov ntaub ntawv thiab <3ft)
3. Sib Nqus Reed Hloov
4.10k Ohm Resistor
5. 22 Ntsuas Hlau (<4ft)
6. Soldering Hlau
7. Cov laug
8. Daim Kab Xev Hluav Taws Xob
9. Zip Ties
10. Tsheb kauj vab nyob ruaj ruaj
11. Tsheb kauj vab
Kauj ruam 1: Rub cov software uas cuam tshuam rau koj lub khoos phis tawj
1. Arduino IDE
2. Tus Saib Xyuas Yees Duab Ceev (Web Browser Extension)
a Google Chrome
b. Firefox
Kauj ruam 2: Kho vajtse
Txhua qhov kev sib txuas yuav tsum tau muab sib dhos ua ke thiab kaw nrog kab xev hluav taws xob. Arduino tuaj yeem ntsia tau rau hauv lub tsheb kauj vab uas siv cov ntaub yas nrog rau Arduino (txuas hauv cov npe ntu saum toj no). Qhov no tseem ceeb vim tias yog lub tsheb kauj vab hlau nyob hauv kev sib cuag ncaj qha nrog tus pin, nws tuaj yeem tsim kev sib txuas tsis xav tau. Cov ntaub ntawv tseem muaj qhov uas ua rau zip-khi rooj plaub rau lub tsheb kauj vab yooj yim. 22 lub xaim hlau yuav tsum tau qhwv raws tus ncej ntawm lub tsheb kauj vab thiab ruaj ntseg nrog daim kab xev lossis zip txuas. Nco ntsoov kom tsis txhob qhwv cov hlau nyob txhua qhov chaw uas nws tuaj yeem raug ntes ntawm cov txheej txheem txav.
Kauj Ruam 3: Muab Tsheb kauj vab tso rau ntawm Lub Caij Tsheb Caij Tsheb
Ruaj lub tsheb kauj vab mus rau hauv lub tsheb kauj vab nyob ruaj ruaj thiab xyuas kom nws ze txaus rau koj lub khoos phis tawj rau lub micro-USB qaum kom ncav cuag koj lub khoos phis tawj. Tsis tas li, nco ntsoov saib qhov nrug rau koj yog qhov tsim nyog tuaj yeem yooj yim pom lub vijtsam. Cov lus qhia yuav ua li cas kom ruaj ntseg tso koj lub tsheb kauj vab ntawm lub rooj muag khoom tuaj yeem pom ntawm no.
Kauj Ruam 4: Upload thiab Xeem Arduino Code
Yog tias koj tshiab rau Arduino IDE, nplooj ntawv taw qhia tuaj yeem pom ntawm no. Nws yog ib qho tseem ceeb kom nco ntsoov Leonardo xav tau micro-USC cable txhawm rau rub tawm uas muaj peev xwm xa cov ntaub ntawv. Ntau lub micro-USB cables tsuas yog siv rau kev them nyiaj xwb thiab cov ntawd yuav tsis ua haujlwm. Thaum Arduino Leonardo tau lees paub los ntawm lub khoos phis tawj, luam tawm thiab muab luam thiab tso cov cai hauv qab no:
// Txoj cai no pom lub tsheb kauj vab nrawm thiab hloov qhov ntawd mus rau lub computer keyboard nias
// xam
// lub vojvoog ntawm lub log ~ 13.5 nti // ib puag ncig = pi*2*r = ~ 85 ntiv tes // max nrawm 35mph = ~ 616inches/thib ob // max rps = ~ 7.25
#suav nrog
#define reed A0 // tus pin txuas nrog nyeem hloov
// storage variables
koj reedVal; lub sijhawm ntev; // sijhawm nruab nrab ntawm ib qho kev sib hloov tag nrho (hauv ms) ntab mph; ntab vojvoog = 13.5; // log vojvoog (hauv nti) ntab ncig; ntab vprevious; tus nqi ntab;
int maxReedCounter = 100; // sijhawm me me (hauv ms) ntawm ib qho kev sib hloov (rau debouncing)
koj reedCounter;
void teeb tsa () {
reedCounter = maxReedCounter; puag ncig = 2*3.14*radius; pinMode (reed, INPUT); Keyboard.begin (); // TIMER SETUP- timer cuam tshuam tso cai ntsuas lub sijhawm ntsuas ntawm qhov hloov pauv reed // kom paub ntau ntxiv txog kev teeb tsa ntawm arduino timers saib https://arduino.cc/playground/Code/Timer1 cli (); // nres cuam tshuam
// teeb tsa timer1 cuam tshuam ntawm 1kHz
TCCR1A = 0; // teeb tsa tag nrho TCCR1A rau 0 TCCR1B = 0; // tib yam rau TCCR1B TCNT1 = 0; // teem sijhawm suav rau 1khz nce OCR1A = 1999; // = (1/1000)/((1/(16*10^6))*8) - 1 // qhib CTC hom TCCR1B | = (1 < <WGM12); // Teeb CS11 me ntsis rau 8 prescaler TCCR1B | = (1 << CS11); // pab kom lub sijhawm sib piv cuam tshuam TIMSK1 | = (1 << OCIE1A); sei (); // tso cai cuam tshuam // Kawg TIMER SETUP Serial.begin (9600); }
ISR (TIMER1_COMPA_vect) {// cuam tshuam ntawm qhov sib txawv ntawm 1kHz los ntsuas qhov hloov pauv
reedVal = digitalRead (reed); // tau txais txiaj ntsig ntawm A0 yog tias (reedVal) {// yog tias qhov hloov pauv reed raug kaw yog tias (reedCounter == 0) {// min lub sijhawm nruab nrab ntawm cov noob tau dhau vprevious = mph; ncua (500); mph = (56.8*ntab (ncig))/ntab (timer); // xam mais ib teev timer = 0; // rov teem sijhawm timer reedCounter = maxReedCounter; // reset reedCounter} ntxiv {yog (reedCounter> 0) {// tsis txhob tso reedCounter mus rau qhov tsis zoo reedCounter -= 1; // txo qis reedCounter}}} lwm qhov {// yog tias reed hloov tau qhib yog (reedCounter> 0) {// tsis txhob cia reedCounter mus tsis zoo reedCounter -= 1;/ /txo qis reedCounter}} yog (timer> 2000) {mph = 0; // yog tias tsis muaj qhov hloov pauv tshiab los ntawm reed hloov- log tsheb tseem nyob, teeb mph rau 0 vprevious = 0; } lwm {timer += 1; // timer nce ntxiv}}
void controlComp () {
yog (vprevious mph) // Slow Video Video Speed {Keyboard.press ('s'); Keyboard.releaseAll (); ncua (750); } yog (vprevious == mph) // tsis ua dab tsi {; }} void loop () {// print mph ob zaug thib ob Serial.print ("VPrevious:"); Serial.print ("\ t"); Serial.println (vprevious);
Serial.print ("MPH:");
Serial.print ("\ t"); Serial.println (mph); tswjComp (); }
Thaum cov cai tau ua tiav xa tawm, qhib qhov saib. Tsis muaj kev txav ntawm lub log tsheb tom qab, "MPH" thiab "VPrevious" yuav tsum nyeem 0.00. Tig lub log kom nws nrawm rau ob peb lub kiv puag ncig thiab tom qab ntawd qeeb. Tus saib xyuas yuav tsum nyeem qhov nrawm thiab hom d's rau kev nrawm thiab s rau kev ua kom qeeb. Yog tias tsis muaj qhov txiaj ntsig tshwm sim thaum lub log tig, lub hlau nplaum yuav tsis raug kuaj pom los ntawm tus pas nrig. Xyuas kom cov hlau nplaum muaj zog txaus los ntawm kev mloog rau kev txiav tawm * clink * suab nrov thaum cov hlau nplaum hla qhov hloov.
Kauj Ruam 5: Teeb YouTube Tus Tswj
Kauj ruam kawg yog nqa YouTube cov vis dis aus uas koj xav siv los ua raws koj lub tsheb kauj vab. Lub tswv yim yog kom muaj thawj tus neeg cov yeeb yaj kiab uas koj tuaj yeem ua rau koj tus kheej nkag siab thiab txaus siab rau qhov pom thaum caij tsheb kauj vab. Kuv tau ua raws YouTube cov npe ntawm ntau yam kev xaiv video. Lawv suav los ntawm tus lej ntawm cov channel uas tso cov vis dis aus uas haum rau tus neeg thawj tus qauv no. Lawv tseem yog cov vis dis aus zoo li ya los ntawm huab thiab hla kev tsheb ciav hlau hla tebchaws rau qee qhov kev lom zem thawj tus neeg.
Pom zoo:
Ncua Sijhawm Tawm Sijhawm Rau Tsheb kauj vab: 5 Kauj Ruam
Ncua Sijhawm Hloov Sijhawm Rau Tsheb kauj vab: Teeb meem: Kuv tau ntxiv cov cuab yeej sib txawv ntawm kuv lub tsheb kauj vab. Qhov teeb meem yog lawv tau txuas ncaj qha rau lub roj teeb thiab lawv kos qhov xau tam sim no lossis tom qab lub hloov tseem ceeb thiab tsis muaj thaum kuv hloov kuv lub tsheb kauj vab.Examples: Koj yuav tsum them nyiaj rau koj
Kev Tau Txais Cov Ntaub Ntawv thiab Cov Ntaub Ntawv Pom Kev Pom Zoo rau MotoStudent Fais Fab Sib Tw Tsheb kauj vab: 23 Kauj Ruam
Kev Tshawb Nrhiav Cov Ntaub Ntawv thiab Cov Ntaub Ntawv Pom Zoo rau MotoStudent Hluav Taws Xob Sib Tw Tsheb: Cov ntaub ntawv khaws cov ntaub ntawv yog cov khoom siv khoos phis tawj thiab software ua haujlwm ua ke txhawm rau sau cov ntaub ntawv los ntawm cov ntsuas sab nraud, khaws thiab ua nws tom qab kom nws tuaj yeem pom cov duab thiab txheeb xyuas, tso cai rau cov kws tsim txuj ci los ua
Tus Ntxhais Lub Tsheb kauj vab Zoo Tshaj Plaws Tsheb Teeb: 12 Kauj Ruam (nrog Duab)
Tus Ntxhais Qhov Zoo Tshaj Plaws Tsheb Tom Qab: Qhov no yog hais txog lub roj teeb ua lub teeb pom kev tom qab hauv lub plawv zoo li daim ntawv.Rau qhov laj thawj kev nyab xeeb, lub teeb nraub qaum zoo yog qhov tseem ceeb rau menyuam yaus caij tsheb kauj vab. Yog li nws yuav tsum ntseeg tau tiag tiag.Koj ib txwm hnov qab tig lub teeb tom qab thaum lawv pib caij tsheb kauj vab. Yog li nws tsis yog
Tsheb kauj vab Infinity - Kev Qhia Tsheb kauj vab hauv tsev: 5 kauj ruam
Tsheb kauj vab Infinity - Kev Qhia Tsheb kauj vab sab hauv tsev: Hauv lub caij ntuj no, hnub txias thiab huab cua tsis zoo, cov neeg caij tsheb kauj vab tsuas yog muaj ob peb txoj hauv kev los qoj ib ce ua lawv nyiam ncaws pob. Peb tab tom nrhiav ib txoj hauv kev los qhia kev sab hauv tsev nrog tsheb kauj vab/tus kws qhia teeb tsa kev lom zem me ntsis tab sis feem ntau
Yuav Txhais Li Cas Kev Taw Qhia ntawm Kev Hloov Los Ntawm Digital Hloov Hloov Nrog PIC: 5 Cov Kauj Ruam
Yuav Ua Li Cas Txhais Tus Cwj Pwm ntawm Kev Sib Hloov Los Ntawm Digital Rotary Hloov Nrog PIC: Lub hom phiaj rau Cov Lus Qhia no yog los piav qhia yuav ua li cas txhawm rau cuam tshuam cov digital (plaub kab cim coded) hloov pauv nrog lub microcontroller. Tsis txhob txhawj, kuv yuav piav qhia dab tsi? Quadrature coded? txhais tau rau peb. Lub interface no thiab cov software txuas nrog wilâ € ¦