Yuav Pib Qhia Koj Tus Menyuam Arduino Li Cas

Cov txheej txheem:

Yuav Pib Qhia Koj Tus Menyuam Arduino Li Cas
Yuav Pib Qhia Koj Tus Menyuam Arduino Li Cas

Video: Yuav Pib Qhia Koj Tus Menyuam Arduino Li Cas

Video: Yuav Pib Qhia Koj Tus Menyuam Arduino Li Cas
Video: Tsis pom qab tu siab (Official Music Video) - Npaub Thoj & Nyiaj Vwj 2024, Kaum ib hlis
Anonim

Koj puas xav kom koj tus menyuam pib kawm siv hluav taws xob thiab tsim khoom siv, tab sis tsis paub pib qhov twg? Koj muaj peev xwm pib thaum hnub nyoog li cas? Kuv hais nrawm rau koj kom sai: txawm tias thaum 5-7 xyoo nws tsis ntxov dhau yog tias nws tuaj yeem nyeem lus Lavxias. Qhov zoo, muaj tam sim no cov lus programming uas tsis tas yuav sau tus lej, thiab koj tus menyuam yuav tso qhov program li duab dhos ua si. Kuv tab tom tham txog ib qho system zoo li "kos rau Arduino" uas sib sau ua ke cov programming thiab cov khoom siv hluav taws xob. Nws yog qhov txiaj ntsig los pib kawm nrog koj tus menyuam.

Yuav pib qhia koj tus menyuam Arduino li cas
Yuav pib qhia koj tus menyuam Arduino li cas

Tsim nyog

  • - khoos phis tawm nrog Arduino IDE;
  • - Is taws nem sib txuas;
  • - Arduino board;
  • - USB cable rau txuas Arduino rau lub khoos phis tawm.

Cov Lus Qhia

Kauj ruam 1

Ua ntej tshaj plaws, koj yuav tsum teeb tsa "Kos rau Arduino" (sau luv luv ntawm S4A) program hauv koj lub computer. Txhawm rau ua li no, mus rau lub xaib https://s4a.cat thiab mus rau ntu Downloads. Rub daim ntawv khaws cia “S4A16.zip” (1.6 yog qhov hloov tshiab tshaj plaws thaum lub sijhawm sau tsab ntawv no). Muab cov ntawv ntim rau qhov chaw ntawm koj lub computer thiab khiav cov ntawv teeb tsa. Ua raws li cov lus qhia ntawm lub installation wizard.

Qhov kev pabcuam teeb tsa
Qhov kev pabcuam teeb tsa

Kauj ruam 2

Yog tias thaum lub sijhawm txheej txheem teeb tsa lub program qhia tias nws ploj lawm ntawm Adobe AIR tivthaiv, koj yuav tsum nruab nws ib yam nkaus. Mus rau nplooj ntawv download https://get.adobe.com/ru/air, rub tawm thiab nruab, tsis muaj dab tsi nyuab.

Tam sim no koj tuaj yeem ua tiav nrog kev teeb tsa ntawm S4A. Ua tiav txheej txheem kev teeb tsa li qub.

Qhov kev pabcuam teeb tsa
Qhov kev pabcuam teeb tsa

Kauj ruam 3

Ua ntej pib qhov kev ua "Scratch for Arduino", koj yuav tsum ua ib qho ntxiv: rub tawm ntawm lub xaib, thiab tom qab ntawd mus rau Arduino nco, cov tswv lag luam los ntawm cov sau phau ntawv "S4A", uas yog hu ua "S4AFirmware16.ino ". Mus rub txuas https://vps34736.ovh.net/S4A/S4AFirmware16.ino. Hmoov tsis zoo, koj yuav tsum thauj nws rau hauv Arduino lub cim xeeb los ntawm hauv qab "tus neeg laus" Arduino IDE ib puag ncig kev loj hlob. Qhib cov ntaub ntawv downloaded hauv ib puag ncig kev txhim kho thiab thauj mus rau Arduino nco li qub.

Kauj ruam 4

Qhov kev npaj tiav dhau los, tam sim no, thaum kawg, peb tuaj yeem pib qhov kev ua "Scratch for Arduino". Tom qab pib, koj yuav pom lub qhov rai hauv daim duab. Hauv seem ntawm lub qhov rais muaj cov ntawv sau "Tshawb rau lub rooj …". Tom qab ob peb lub vib nas this, nws yuav tsum ploj - qhov kev pab cuam yuav tshawb Arduino board thiab txuas rau nws.

Lub interface ntawm cov kev pab cuam "kos rau Arduino"
Lub interface ntawm cov kev pab cuam "kos rau Arduino"

Kauj ruam 5

Yog tias nyob hauv 10 vib nas this cov lus sau tsis ploj, nyem rau ntawm cov phiaj vaj huam sib luag uas qhov kev tshawb fawb tseem tab tom ua, nyem-xaiv thiab xaiv "Tshawb nrhiav chaw nres nkoj" yam khoom Tom qab ntawd nyem dua thiab nyem "Xaiv Serial / USB Port". Qhia kom meej tus lej chaw nres nkoj uas cov kab ke ua haujlwm muab rau Arduino board (tuaj yeem pom hauv tus thawj tswj hwm lub ntaus ntawv). Tshawb nrhiav lub rooj tsavxwm dua. Tam sim no nws yuav tsum tau txhais los ntawm cov programme. Qhov kev vam meej yuav muaj pov thawj los ntawm cov lej ua haujlwm hauv Analog0 … Analog5 teb (txaws ntawm lub pins ntawm Arduino) thiab qhov ploj ntawm cov ntawv "Tshawb nrhiav lub rooj tsavxwm".

Tam sim no koj tuaj yeem hu koj tus menyuam thiab pib lub program.

Cia peb muab tso ua ke ib qhov kev pab cuam yooj yooj yim los ntawm cov ntawv sib dhos uas yuav ua cov hauv qab no: thaum koj nias lub khawm nas laug, taws teeb ua LED hauv Arduino board, thiab thaum tso tawm, tig nws tawm.

Nrhiav Arduino board nyob rau hauv "Scratch for Arduino"
Nrhiav Arduino board nyob rau hauv "Scratch for Arduino"

Kauj Ruam 6

Nyem rau "Tswj" khawm nyob rau sab saud ib feem ntawm qhov kev pab cuam lub qhov rai. Xaiv lub "Thaum chij ntsuab yog nyem" duab dhos ua si. Luag rau lub npov nruab nrab. Tam sim ntawd xaiv cov duab dhos ua si "Txhua Lub Sijhawm" thiab tseem rub nws mus rau qhov chaw nruab nrab. Txuas nws rau thawj tus (cov lus taw yuav tsum sib phim). Xaiv cov duab dhos ua si "Yog hais tias … txwv tsis pub" thiab ntxig rau sab hauv "Ib txwm" thaiv (qhov no yuav ua rau peb qhov kev zov me nyuam los ua rau muaj kev cuam tshuam tas li thaum lub pob nyem khawm).

Tam sim no nyem lub pob Tsav nyob sab saum toj. Tsav cov "Digital 13 rau" thiab "Digital 13 tawm", ntxig rau thawj tus rau hauv qhov siab tshaj, qhov thib ob nkag mus rau hauv qis dua thaiv "Yog tias … txwv tsis pub" (13 tus lej digital ntawm Arduino tau txuas nrog lub built- hauv LED, peb yuav qhib nws) …

Muaj ib qho kawg kawg ntawm sab laug: nyem lub pob "Sensors", xaiv lub pob "Mouse Pressed" puzzle thiab ntxig nws mus rau qhov kawg ntawm cov khoob tas ntawm peb qhov sib dhos.

Tam sim no nyem rau ntawm lub box ntsuab ntsuab ntawm lub ces kaum sab sauv - qhov no yuav tso qhov program. Cov nyom caij nyoog yuav tsum tau hais hauv dawb.

Yog tias koj tam sim no nyem nrog nas, koj yuav pom cov LED ntawm Arduino board teeb, thiab thaum tso tawm, nws tawm mus. Qhuas koj tus menyuam txog nws thawj qhov program uantej!

Pom zoo: