Dab Tsi Yog Daim IDE Rau Kev Ua Haujlwm Nrog Arduino

Cov txheej txheem:

Dab Tsi Yog Daim IDE Rau Kev Ua Haujlwm Nrog Arduino
Dab Tsi Yog Daim IDE Rau Kev Ua Haujlwm Nrog Arduino

Video: Dab Tsi Yog Daim IDE Rau Kev Ua Haujlwm Nrog Arduino

Video: Dab Tsi Yog Daim IDE Rau Kev Ua Haujlwm Nrog Arduino
Video: 6 Nqi Lus Qhia Kev Ua neej ( leej twg mloog lub neej yuav zoo tuaj) 2024, Hlis ntuj nqeg
Anonim

Txhua tus neeg uas pib kawm Arduino yeej paub txog Arduino IDE. Nws tso cai rau koj los sau cov kab kos, tshawb xyuas qhov tseeb thiab thauj lawv mus rau hauv lub cim xeeb ntawm Arduino boards. Tab sis puas yog tib txoj kev tsim kho cov kev pab cuam rau Arduino? Tsis yog lintawd! Saib seb lwm qhov chaw muaj kev loj hlob nyob ua ib ke.

Arduino logo
Arduino logo

Tsim nyog

  • - Arduino;
  • - khoos phis tawj.

Cov Lus Qhia

Kauj ruam 1

Cia peb pib nrog PROGRAMINO kev txhim kho ib puag ncig. Qhov no yog kev them nyiaj ib puag ncig, tab sis koj tuaj yeem sim tawm ntawm 14 hnub pub dawb. Programino, zoo ib yam li lwm qhov kev loj hlob ib puag ncig, xav tau, txawm li cas los xij, koj tau nruab Arduino IDE. Thaum koj pib qhov kev pab cuam rau thawj zaug, qhia kom meej txoj hauv kev ntawm arduino.exe executable cov ntaub ntawv hauv cov chaw. Txhawm rau ua qhov no, mus rau hauv cov ntawv qhia zaub mov: Xaiv -> Editor Settings. Lub qhov rai yuav tshwm nyob rau qhov uas koj yuav tsum tau qhia txoj kev rau cov ntawv qhia chaw nrog Arduino IDE thiab cov chaw qiv muaj feem xyuam. Tam sim no peb npaj siab los sau cov programmes hauv Programino.

Chaw ua haujlwm Programino ib puag ncig
Chaw ua haujlwm Programino ib puag ncig

Kauj ruam 2

Cov lus siv nyob rau hauv qhov kev txhim kho no ib puag ncig yog tib yam li hauv Arduino IDE qub - C. Ntawd yog, qhov tseeb, yog tias koj twb tau sau cov duab kos nyob hauv Arduino IDE, tom qab ntawd koj yuav tsis tas kawm cov kev sau ntawv tshiab, uas yog ib qho loj ntxiv ntawm qhov kev loj hlob no.

Txawm li cas los xij, ntxiv rau, IDE no muaj txoj hauv kev yooj yim ntawm txoj kev loj hlob sai npaum li kev ua tiav. Ntawd yog, koj tsis tas yuav mus tas li los ntawm Arduino cov lus txib thiab txoj kev siv. Koj pib sau cov code, thiab kev tsim kho thaj chaw yuav ua rau koj xaiv qhov koj xav tau los ntawm cov kev xaiv muaj. Piv txwv li, koj ntaus "digi" thiab IDE muaj cov kev xaiv rau koj: "digitalRead", "digitalWrite".

Cia peb sau cov qauv kos duab yooj yim uas peb yuav xaiv ib qho ntawm cov pev txawb ntawm Arduino thiab tsim tawm cov ntawv nyeem rau lub chaw nres nkoj serial. Sim ntaus cov duab kos los ntawm txhais tes, ntau dua li luam thiab muab tshuaj txhuam, kom hnov qhov yooj yim ntawm Programino code tiav.

Sketch hauv Programino
Sketch hauv Programino

Kauj ruam 3

Qhov kev nthuav qhia dab tsi ntxiv ntawm Programino IDE muaj? Txoj kev loj hlob ib puag ncig no muaj ntau lub tswv yim zoo uas muaj nyob hauv Cov Ntawv Qhia Ntawv. Piv txwv, notepad, LCD cim tsim, hloov pauv ntawm DEC-BIN-HEX, lub chaw nres nkoj serial, cov phiaj xwm analog thiab lwm tus.

Cia wb saib ze rau Analog Plotter twj. Cov cuab yeej no tso cai rau koj ua kom pom tseeb txog dab tsi los rau hauv qhov chaw nres nkoj COM los ntawm Arduino. Qhov no tuaj yeem pab tau, piv txwv, txhawm rau txhawm rau nyeem ntawv ntawm qee qhov kev sib txuas ntawm lub ntsuas hluav taws xob: ntsuas kub, av noo, siab, taws teeb, thiab lwm yam.

Rau tus neeg ua haujlwm hauv daim phiaj kom ua haujlwm kos duab, koj yuav tsum qhib lub chaw nres nkoj hauv ceev ntawm 19200 kb / s. Cov ntaub ntawv luam tawm mus rau plotter siv Serial.println (). Cia peb pib ib qho cuab yeej cuab tam ib qho. Nias lub Pob Txuas Mus txuas rau qhov chaw nres nkoj uas peb tau txuas nrog Arduino.

Analog plotter hauv Programino
Analog plotter hauv Programino

Kauj ruam 4

Lwm qhov kev xaiv nthuav zoo rau Arduino IDE yog B4R, lossis "Basic rau Arduino". Ib qho txuas rau cov nom tswv yog tseem muab rau ntawm qhov kawg ntawm tsab xov xwm. Qhov chaw loj hlob no nthuav dav vim nws siv cov lus yooj yim siv C. Nws tseem txhawb nqa ua tiav code. Ntxiv rau, nws yog dawb kiag li.

Thaum pib thawj zaug, B4R ib puag ncig kuj xav kom koj yuav tsum qhia txoj kev mus rau phau ntawv teev npe nrog Arduino IDE, ntxiv rau, yog tias tsim nyog, ntxiv cov tsev qiv ntawv uas tsis tau txheem thiab cov qauv siv sib txawv. Cov chaw no tuaj yeem tsim teeb tom qab ntawm Cov Cuab yeej-> Configure Paths cov ntawv qhia zaub mov.

Kev teeb tsa ib puag ncig B4R
Kev teeb tsa ib puag ncig B4R

Kauj ruam 5

Cia peb sau cov duab kos zoo li qhov no thiab tib lub sijhawm saib ze B4R IDE.

Hauv nruab nrab lub hauv paus muaj ib daim teb rau kho cov code. Ntawm sab xis yog thaj chaw tabs thiab cov tabs lawv tus kheej: muaj cov tsev qiv ntawv, kos duab qauv, keeb kwm thiab tshawb. Ib lub tab nrog cov ntawv xov xwm yog qhib rau ntawm daim duab saum toj no. Nws tuaj yeem pom tias cov lus tau qhia ntawm no, uas tau teeb tsa hauv qhov program los ntawm Log () hais kom ua. Hauv qhov kev txhim kho puag ncig no, koj tuaj yeem tsim cov khoom tawg, uas yog qhov muaj txiaj ntsig zoo rau hauv qhov txheej txheem debugging, thiab tseem siv tau cov ntawv cim rau kev taw qhia nrawm dhau los ntawm txoj cai.

Koj yuav tsis muaj peev xwm pib lub phiaj xwm hauv qhov kev txhim kho no tam sim ntawd, vim tias nws siv cov lus sib txawv, cov lus hais tshaj dua qub ntawm hom Arduino IDE, uas muaj cov ntsiab lus sib txawv. Txawm li cas los xij, qhov yooj yim ntawm thaj chaw no thiab qhov muaj cov lus qhia zoo los ntawm cov neeg tsim tawm ua rau muaj qhov tsis zoo no.

Thawj daim duab hauv B4R
Thawj daim duab hauv B4R

Kauj Ruam 6

Muaj lwm qhov chaw tsim kho rau Arduino dua li cov tau teev tseg. Piv txwv li, Codeblocks. Nws muaj tib lub peev xwm raws li cov tau piav qhia los ntawm IDE, yog li kuv yuav tsis piav qhia nws thoob plaws.

Tab sis tam sim no koj paub tias muaj lwm txoj hauv kev, muaj ntau yam yooj yim dua, kev tsim kho thaj chaw rau Arduino. Siv lawv yuav yooj yim heev thiab ua kom qhov kev txhim kho ntawm koj tus kheej sketches.

Pom zoo: