Cov txheej txheem:

Siv Tus Neeg Siv Teeb Duab rau Arduino Nrog Teev Sijhawm ntawm Txoj Cai Qhia: 3 Kauj Ruam
Siv Tus Neeg Siv Teeb Duab rau Arduino Nrog Teev Sijhawm ntawm Txoj Cai Qhia: 3 Kauj Ruam

Video: Siv Tus Neeg Siv Teeb Duab rau Arduino Nrog Teev Sijhawm ntawm Txoj Cai Qhia: 3 Kauj Ruam

Video: Siv Tus Neeg Siv Teeb Duab rau Arduino Nrog Teev Sijhawm ntawm Txoj Cai Qhia: 3 Kauj Ruam
Video: Computer Vision with Python! Resizing Images 2024, Hlis ntuj nqeg
Anonim
Siv Cov Neeg Hlau Teeb Duab rau Arduino Nrog Teev Sijhawm ntawm Code Tutorials
Siv Cov Neeg Hlau Teeb Duab rau Arduino Nrog Teev Sijhawm ntawm Code Tutorials
Siv Cov Neeg Hlau Teeb Duab rau Arduino Nrog Teev Sijhawm ntawm Code Tutorials
Siv Cov Neeg Hlau Teeb Duab rau Arduino Nrog Teev Sijhawm ntawm Code Tutorials
Siv Cov Neeg Hlau Teeb Duab rau Arduino Nrog Teev Sijhawm ntawm Code Tutorials
Siv Cov Neeg Hlau Teeb Duab rau Arduino Nrog Teev Sijhawm ntawm Code Tutorials

Kuv tsim Arduino tus neeg hlau kos duab rau kev cob qhia los pab cov ntxhais hluas kom txaus siab rau cov ncauj lus STEM (saib https://www.instructables.com/id/Arduino-Drawing-Robot/). Tus neeg hlau tau tsim los siv Turtle-style programming cov lus txib xws li rau pem hauv ntej (nrug) thiab tig (lub kaum ntse ntse) los tsim cov pasterns uas ntxim nyiam.

Thaum lub rooj cob qhia, peb tau siv "Anna thiab Elsa" qhia los ntawm Teev Sijhawm ntawm Txoj Cai los pab cov neeg koom nrog kom paub txog kev ua haujlwm hauv kev npaj rau kev tsim lawv cov neeg hlau. Cov kev qhia siv cov phiaj xwm txheej txheem txhawm rau txhawm rau zam kev thaiv txoj hauv kev ntawm kev ntaus ntawv thiab cov syntax, tab sis qhov sib npaug JavaScript code tuaj yeem pom, tsim tus choj zoo rau kawm paub siv ntau yam thiab muaj zog lus programming.

Peb qhov kev tshawb pom yog tias txij li kev qhia siv cov lus txib zoo sib xws rau kev txav Anna ib ncig ntawm lub vijtsam, thiab tias JavaScript tus qauv kev teeb tsa zoo ib yam li Arduino C code, qhov kev kos duab tus qauv tuaj yeem tsim thiab sim hauv qhov browser, thiab tom qab ntawd tsim JavaScript code tau theej thiab hloov kho kom tsav tus neeg hlau hauv Arduino! Kev siv cov cai los tswj qee yam hauv ntiaj teb lub cev yog qhov ua qhia pom ntawm lub zog ntawm lub cajmeem.

Kauj Ruam 1: Teev Sij Hawm Ntawm Txoj Cai Qhia

Teev Sij Hawm Ntawm Txoj Cai Qhia
Teev Sij Hawm Ntawm Txoj Cai Qhia
Teev Sij Hawm Ntawm Txoj Cai Qhia
Teev Sij Hawm Ntawm Txoj Cai Qhia
Teev Sij Hawm Ntawm Txoj Cai Qhia
Teev Sij Hawm Ntawm Txoj Cai Qhia

Ob qho "Anna thiab Elsa" thiab "Artist" Teev Sijhawm ntawm Code qhia siv cov lus txib xws li "txav" thiab "tig" kom txav cov cim nyob ib ncig ntawm lub vijtsam. Raws li kev qhia ua ntu zus, koj kawm lub zog ntawm loops thiab zes loops. Hauv qib 12 ntawm Anna piv txwv, koj siv cov kab sib txuas ua ke los tsim txiv leej txiv daus. Thaum kawg ntawm qhov kev qhia, koj tau muab daim ntawv dawb los sim nrog.

Kauj ruam 2: Pib Arduino Code

Pib Arduino Code
Pib Arduino Code

Yog tias koj xav tau kev pab pib nrog Arduino, tsis muaj qhov chaw zoo dua los pib dua li "Pib Nrog Arduino" nplooj ntawv ntawm www. Arduino.cc.

Koj, ntawm chav kawm, yuav tsum tau tsim thiab sim koj li Arduino Drawing Robot.

Kuv tau sau cov cai uas saib xyuas txhua qhov ntsiab lus ntawm kev tsav lub cav tsheb thiab muab cov lus yooj yim rau kev txav thiab tig. Rub tawm daim duab txuas nrog Arduino thiab muab tso rau hauv koj phau ntawv teev npe Arduino. Tom qab ntawd qhib nws nrog Arduino IDE. Nws yuav thov kom muab nws tso rau hauv daim nplaub tshev tshiab, uas yog qhov zoo.

Kauj Ruam 3: Hloov Kho Txoj Cai

Hloov Txoj Cai
Hloov Txoj Cai
Hloov Txoj Cai
Hloov Txoj Cai
Hloov Txoj Cai
Hloov Txoj Cai

Thaum koj muaj tus qauv hauv qhov kev qhia koj xav siv, nyem rau ntawm "Qhia Code" khawm. Luam thiab paste cov cai rau hauv lub voj () ua haujlwm ntawm Arduino kos duab. Cov cai no yog los ntawm Anna thiab Elsa Kauj Ruam 11:

rau (var count2 = 0; count2 <4; count2 ++) {rau (var suav = 0; suav <2; suav ++) {txav mus rau tom ntej (100); tig rov qab (60); txav mus rau tom ntej (100); tig rov qab (120); } tig rov qab (90); }

Nco ntsoov tias "var" JavaScript yam sib txawv tsis yog hom ntaub ntawv hom Arduino. Qhov sib npaug yuav yog "int" rau cov lej. Txhawm rau ua lub neej yooj yim, kuv tau ntxiv qee cov cai kom Arduino paub tias thaum peb hais "var", peb txhais tau tias "int". Code yog txhua yam hais txog kev paub daws teeb meem.

Sau thiab xa cov cai! Nws yog qhov yooj yim xwb. Yog tias tus neeg hlau kos duab tsis phim qhov koj tau txais hauv qhov kev qhia, koj yuav xav tau ntsuas koj tus neeg hlau lossis tshawb xyuas lub log xoob lossis rub qhov.

Qhia rau kuv paub dab tsi koj tuaj nrog!

Pom zoo: