Cov txheej txheem:
- Kauj Ruam 1: Txuas mus rau I2C Network Bus
- Kauj Ruam 2: Ntxiv Pullup Resistors
- Kauj Ruam 3: Program Tus Qhev
- Kauj Ruam 4: Program Master
Video: Txuas Ob OOBoards Ua Ke Siv I2C: 4 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:30
Cov lus qhia no qhia txog yuav ua li cas txuas ob OOBoards siv I2C.
Kauj Ruam 1: Txuas mus rau I2C Network Bus
Muaj ob lub tsheb npav I2C ntawm OOBoards, tsheb npav hauv nroog, thiab tsheb npav sib txuas.
OOPIC code yog qhov tseem ceeb txhais lus, piv txwv li "tus lej" tau khaws cia hauv EEPROM, thiab nyeem/txhais los ntawm microprocessor hauv lub sijhawm. EEPROM siv LOCAL I2C tsheb npav los sib txuas lus nrog lub microcontroller. Yog tias koj tau saib lub npav no hauv zos ntawm oscilloscope, koj yuav pom kev sib tham tas li. Ntawm OOBoards cov laug cam, lub tsheb npav hauv zos yog qhov txuas nrog I2C txuas, qhov no tsis tas yuav yog yam peb xav tau. Lub npav NETWORK feem ntau yog lub npav uas siv los sib txuas lus nrog lwm cov khoom siv/oopics, ntawm OOBoards lub npav no tsis muaj tus txuas. Txhawm rau nkag mus rau lub npav no, koj yuav tsum tau siv cov xaim xaim txuas rau tus pin 42 thiab 37 ntawm lub microcontroller (cim N_SDA, N_SCL ntawm cov txheej txheem feem).
Kauj Ruam 2: Ntxiv Pullup Resistors
Thaum SDA thiab SCL kev sib txuas ua tiav ntawm txhua tus txheej txheem, ob lub rooj tsavxwm tuaj yeem ua tau
sib txuas ua ke los ntawm kev txuas SDA rau SDA, SCL rau SCL, thiab txuas ib qho xov hlau hauv av ntawm cov laug cam. Koj tseem yuav xav tau rub tawm tus neeg tawm tsam ntawm txhua kab (kuv siv 12k, tab sis qhov ntawd tsuas yog qhov kuv tau dag ib ncig). Nco ntsoov tias koj tsuas xav tau ib tus rub tawm cov kab tawm ntawm ib kab rau tag nrho ntawm ob tus neeg tawm tsam (tsis yog 4).
Kauj Ruam 3: Program Tus Qhev
Tam sim no hais tias kev sib txuas ntawm lub cev nyob ntawd, koj yuav tsum tau teeb tsa tus qhev microcontroller. Kuv ntxiv qee cov cai hauv qab no uas yuav tsum tau koj pib.
Dim SLAVE Raws Li Tshiab oDDELinkDim LED Raws Li Tshiab oDIO1Sub Main () & tshem tawm peb qhov chaw nyob I2C rau 2 (nco ntsoov, qhov no yuav tsum phim cov chaw taws teeb & aposaddress peb teeb tsa hauv tus lej tswv) ooPIC. Node = 2 & apossetup ib qho LED. IOLine = 5 LED. Direction = cvOutput & aposnow, txuas qhov tso tawm ntawm peb DDELink cov khoom rau & aposthe LED, thiab tig nws… tam sim no automagically, cov LED yuav ntsais SLAVE. Output. Link (LED) SLAVE. Operate = cvTrueEnd Sub
Kauj Ruam 4: Program Master
Thaum kawg, teeb tsa tus tswv microcontroller. Ua tib zoo mloog cov kab uas teeb tsa DDELink's. Location property: Tshwj tsis yog qhov no tau teeb tsa kom raug, qhov no yuav tsis ua haujlwm!
Dim Tswv Raws Li Tshiab oDDELinkDim hlau Raws Li Tshiab oWireDim hz1 Raws li Tshiab oBitSub Main () & aposlink lub sijhawm thib ob thib ob rau qhov me ntsis peb tuaj yeem nkag mus & aposthis me ntsis yuav tam sim no toggle ib zaug thib ob xaim. Txuas (hz1) wire. Operat = cvTrue & aposthis teeb tsa I2C chaw nyob ntawm peb lub microcontroller hauv zos & tus thwjtim I2C interface tsis ua haujlwm kom txog thaum qhov chaw nyob tau teeb tsa ooPIC. Node = 1 & aposnow peb teeb tsa peb DDELink cov khoom, peb cov tswv yim yog me ntsis hz1 & aposnote tias khoom kuj muaj. Output cuab yeej siv & aposwhen thaum peb tau txais hom Master. Input. Link (hz1) & aposthis yog I2C chaw nyob ntawm cov chaw taws teeb microcontroller, nco ntsoov tias & aposin tus qhev txoj cai, peb qhia nws kom muaj chaw nyob ntawm 2 Master. Node = 2 & aposugh… qhov no yog qhov tsis zoo, qhov no yog “chaw nyob” ntawm DDELink & aposobject hauv tus qhev & qhov chaw nco nco. Txhawm rau txiav txim siab tus lej no, & aposwe xav tau qhib thiab suav sau tus lej qhev, tom qab ntawd mus rau View-> Compiled Code. & aposlook rau qee yam xws li: & aposL *. Construct. Begin; Dim li tshiab oDDELink & aposwhere * yog tus lej, thiab yog lub npe ntawm koj li DDELink cov khoom & aposin koj tus lej qhev. Kab ntawv tam sim hauv qab no nws yuav tsum nyeem qee yam xws li: & aposC0020: 041; Qhov no.. Tus lej & tus lej thwjtim rau sab xis ntawm & apos: & apos yog qhov chaw nyob ntawm tus qhev DDELink lub hom phiaj Master. Location = 41 & aposthis qhia cov khoom uas peb yuav xa mus cov ntaub ntawv (piv txwv li, theej cov ntaub ntawv los ntawm peb. Input cuab yeej & Aposto cov qhev. tawm cov cuab yeej (nco ntsoov, yog tias koj teeb tsa qhov no kom tau txais, nws yog qhov rov qab) = cvTrue Ua & aposcheck kom pom tias tam sim no peb tab tom xa cov ntaub ntawv Yog Master. Transmitting = cvFalse Tom qab ntawd & suav cov nqi no rau 1 yuav ua rau tus tswv xa tus nqi rau tus qhev & aposnote, qhov no tau rov pib dua rau 0 thaum ua tiav ntawm Master. Sync = 1 End Yog LoopEnd Sub
Pom zoo:
Txuas Txuas Txuas Txuas: 5 Cov Kauj Ruam
Txuas Txuas Lub Sijhawm: Nyob Zoo! Hauv qhov kev qhia no koj yuav pom yuav ua li cas txuas nrog ib qho khoom siv Arduino sib xws, nruab nrog WiFi, rau REST APIs! Qhov no siv GitKraken Glo Board webapp los tsim cov laug cam, kab & daim npav los npaj khoom! Qee qhov kev paub ntawm yuav ua li cas pej xeem
Kev Sib Txuas Txuas Txuas Txuas Siv Bluefruit: 4 Cov Kauj Ruam
Kev Sib Txuas Tsis Sib Txuas Siv Bluefruit: Nov yog cov lus qhia yooj yim los ntawm kauj ruam qhia los hloov koj cov xov hlau nrog bluetooth tsis muaj zog txuas: Nws coj kuv ib pliag los daws qhov no vim tias tsis muaj cov ntaub ntawv hais txog kev ua qhov no nrog bluetooth niaj hnub tsis muaj zog thev naus laus zis raws li Bluefrui
EZ Kev Sib Txuas Txuas Txuas Txuas Ntxiv - Tsis Muaj Tus Kheej! (CSRC-311): 7 Kauj Ruam
EZ Kev Sib Txuas Txuas Txuas Txuas Ntxiv - Tsis Muaj Tus Kheej! (CSRC-311): Tsis ntev dhau los ntawm Azamom.com (thov txim, tam sim no tau muag tawm) Kuv tau hla qhov kev pom zoo zoo ntawm Common Sense RC CSRC-311 tus qauv-siv servos.Noj zoo, Kuv xav hloov qee yam ntawm tsis tu ncua kev sib hloov. Txoj kev kuv tuaj nrog yog yooj yim heev thiab xav tau
Yuav Ua Li Cas Txuas Txuas Rau 9v Roj Teeb Siv Cov Hluav Taws Xob: 6 Cov Kauj Ruam
Yuav Txuas Li Cas Rau 9v Roj Teeb Siv Cov Hluav Taws Xob: Yuav ua li cas txuas coj mus rau 9v roj teeb piav qhia yooj yim uas txhua tus tuaj yeem nkag siab thiab siv nws rau cov phiaj xwm hluav taws xob. Txhawm rau ua cov khoom no, peb yuav tsum paub peb cov khoom
Cov lus qhia rau Ua Plaub Qhov Kev Txuas Txuas Txuas Rau Qhov Chaw Mounted Footrest: 9 Cov Kauj Ruam (nrog Duab)
Cov lus qhia rau Ua Plaub Qhov Kev Txuas Txuas Txuas Rau Lub Hauv Paus Mounted Footrest: Mid-drive fais fab log lub rooj zaum (PWC) tau dhau los ua neeg nyiam nyob rau xyoo tas los no. Txawm li cas los xij, vim qhov kev tso rau pem hauv ntej casters, cov tsoos sab-mounted footrests tau hloov los ntawm ib qho chaw nruab nrab-footrest. Hmoov tsis zoo, center-mou