Cov txheej txheem:

Blinking Electronic Textile Hnab: 4 Cov Kauj Ruam
Blinking Electronic Textile Hnab: 4 Cov Kauj Ruam

Video: Blinking Electronic Textile Hnab: 4 Cov Kauj Ruam

Video: Blinking Electronic Textile Hnab: 4 Cov Kauj Ruam
Video: 4х канальное Zigbee реле ZG-003-RF с сухими контактами - способы подключения, режимы работы 2024, Kaum ib hlis
Anonim
Image
Image
Npaj lub Rooj Tswjhwm Saib thiab Lub Hnab
Npaj lub Rooj Tswjhwm Saib thiab Lub Hnab

Hauv qhov kev qhia no koj yuav kawm paub yuav ua li cas kom muaj LED thaj ntawm koj lub hnab ntim khoom ntsais ntsais.

Kauj Ruam 1: Npaj Pawg Thawj Coj thiab Lub Hnab

Npaj lub Rooj Tswjhwm Saib thiab Lub Hnab
Npaj lub Rooj Tswjhwm Saib thiab Lub Hnab
Npaj lub Rooj Tswjhwm Saib thiab Lub Hnab
Npaj lub Rooj Tswjhwm Saib thiab Lub Hnab

Txuas ib kawg ntawm micro usb cable rau lub khoos phis tawj, lwm qhov kawg rau Arduino Leonardo pawg thawj coj saib.

Txuas qhov zoo ntawm LED thaj rau tus pin 13 ntawm Arduino Leonardo. Txuas qhov tsis zoo ntawm LED thaj rau GND ntawm lub rooj tsavxwm. Koj tuaj yeem siv ib qho ntawm 3 GND pins muaj nyob ntawm pawg thawj coj. dub cable - GND txiv kab ntxwv cable - tus pin 13

Kauj Ruam 2: Teeb tsa Pawg Thawj Coj ntawm MBlock

Teeb tsa Pawg Thawj Coj ntawm MBlock
Teeb tsa Pawg Thawj Coj ntawm MBlock
Teeb tsa Pawg Thawj Coj ntawm MBlock
Teeb tsa Pawg Thawj Coj ntawm MBlock

Ua ntej koj tuaj yeem pib tsim koj lub Arduino, koj yuav tsum teeb tsa nws ntawm mBlock.

Xaiv qhov version nyob ntawm koj lub operating system (piv txwv li yog tias koj muaj MacBook, xaiv "Mac OS" / yog tias koj muaj Windows 10, xaiv "Windows 7 thiab siab dua"). Rub tawm thiab khiav cov ntaub ntawv teeb tsa thiab tom qab ntawd qhib mBlock.

Xaiv pawg Arduino Leonardo los ntawm "Boards" ntawv qhia zaub mov.

Tom qab ntawd txuas rau koj lub Rooj Tswjhwm Saib Arduino (tus lej chaw nres nkoj COM sib txawv raws koj lub khoos phis tawj USB ntsaws - thaum koj xaiv qhov raug uas koj Arduino Leonardo txuas nrog, ON thiab TX coj teeb ntawm lub rooj tsavxwm yuav tig ntsuab, thiab txiv kab ntxwv. feem).

Kauj Ruam 3: Coding ntawm MBlock

Coding ntawm MBlock
Coding ntawm MBlock
Coding ntawm MBlock
Coding ntawm MBlock

Ntawm mBlock, koj yuav tsum tsim cov cai yooj yim kom muaj koj li thaj ua rau muag ntsais muag txhua ob.

Txoj cai yuav tsum zoo li qhov no: (saib duab)

Koj yuav tsum tau rub thiab poob txhua qhov thaiv los ntawm ntu "Scripts" ntawm nruab nrab mus rau qhov chaw seem ntawm sab xis. Koj yuav pom txhua qhov thaiv hauv cov kab lus hauv qab no: Thaum nyem - "Txheej xwm" ntu ntu tas mus li / tos 1 secs - "Tswj" ntu ntu teeb tsa tus lej digital … - ntu "Neeg Hlau"

Nco tseg qhov koj tuaj yeem hloov pauv me me los ua koj tus kheej tus lej. Piv txwv li koj tuaj yeem hloov pauv qhov kev ntsais muag los ntawm kev luv lossis ntev ncua ntawm txhua lub xeev "HIGH" thiab "LOW" xeev tus pin 13.

Thaum koj ua tiav kev sau npe, nyem rau "Txhim Kho Firmware" hauv Cov Ntawv Qhia Txuas (ntawm qhov taw tes ob qho tib si RX thiab TX coj teeb ntawm lub rooj tsavxwm yuav nyem txiv kab ntxwv).

Ua li no ib zaug xwb. Tam sim no koj tuaj yeem hloov kho koj cov cai yam tsis tas yuav hloov kho Firmware txhua lub sijhawm.

Kauj Ruam 4: Coding ntawm Arduino IDE

Coding ntawm Arduino IDE
Coding ntawm Arduino IDE
Coding ntawm Arduino IDE
Coding ntawm Arduino IDE
Coding ntawm Arduino IDE
Coding ntawm Arduino IDE

Nws muaj peev xwm tias koj yuav ntsib teeb meem txuas koj Arduino leonardo rau mBlock. Hauv qhov xwm txheej ntawd, koj yuav xav tau siv Arduino IDE rau tus lej thiab xa cov firmware rau koj li Arduino Leonardo board.

Rub tawm lub software los ntawm kev mus xyuas Arduino IDE> Scroll down kom txog thaum koj pom "Rub tawm Arduino IDE" ntu thiab xaiv cov version raws li koj lub operating system (piv txwv li Yog tias koj muaj Windows 7, xaiv "Windows Installer" / yog tias koj muaj Windows 10, xaiv "Windows app")> Ntawm nplooj ntawv tom ntej xaiv "Tsuas yog rub tawm" thiab khiav cov ntaub ntawv teeb tsa. Tua tawm Arduino IDE thiab xaiv Arduino Leonardo los ntawm cov cuab yeej ntawv qhia zaub mov> Pawg.

Xaiv qhov chaw nres nkoj raug los ntawm cov cuab yeej ntawv qhia zaub mov> Chaw nres nkoj.

Xaiv qhov Blink piv txwv los ntawm File> Piv txwv> 01. Basics> Blink. Thaum kawg, xa cov cai los ntawm kev siv tus xub xub (→) khawm nyob rau sab xis saum toj ntawm lub qhov rais, los ntawm kev xaiv Sketch> Upload lossis los ntawm nias Ctrl+U ntawm cov keyboard.

Xwb, koj tuaj yeem siv ob qho cuab yeej ua ke txhawm rau yooj yim tsim cov cai (los ntawm kev siv qhov yooj yim interface mBlock muab) thiab tom qab ntawd ntseeg tau tso nws mus rau pawg thawj coj (los ntawm kev siv kev sib txuas zoo rau pawg thawj coj uas Arduino IDE muab).

Hauv mBlock, koj tsuas xav tau nyem rau Kho kom raug> Hom Arduino thiab thaum lub pane tshiab qhib rau ntawm sab xis, xaiv Kho nrog Arduino IDE.

Tom qab ntawd, ua raws cov theem ib yam nkaus li ua ntej txhawm rau xa cov cai rau hauv lub rooj tsavxwm thiab koj yuav tsum zoo mus!

Pom zoo: