Cov txheej txheem:

Arduino Tutorial: Flicker LED: 3 Kauj Ruam
Arduino Tutorial: Flicker LED: 3 Kauj Ruam

Video: Arduino Tutorial: Flicker LED: 3 Kauj Ruam

Video: Arduino Tutorial: Flicker LED: 3 Kauj Ruam
Video: How to Blink an LED with Arduino (Lesson #2) 2024, Kaum ib hlis
Anonim
Arduino Tutorial: Flicker LED
Arduino Tutorial: Flicker LED

Nkees ntawm tag nrho lwm cov lus qhia txog yuav ua li cas ntsais lub LED? zoo li cas txog flickering LED? eh? muaj ible txhua yam hais txog kev flickering LED.

Kauj ruam 1: Kev thaiv kab

Thaiv
Thaiv

Ua ntej peb teeb tsa arduino peb yuav tsum tau teeb tsa txhua yam.

A) Txuas koj lub arduino rau lub khoos phis tawm ntawm USB cable. B) Ntxiv cov coj zoo coj mus rau tus pin 10 ntawm tus lej, tom qab ntawd nrog qhov tsis zoo ua rau GND (hauv av) tus pin kuj ntawm tus lej C) Khiav Arduino IDE software. D) Mus rau kauj ruam tom ntej rau cov cai. siv daim duab hauv qab no xaim koj cov arduino (yog tias koj tsis nkag siab dab tsi kuv tau txais ntawm no)

Kauj ruam 2: Ze Code

Zoj Code
Zoj Code

txhawm rau ua kom lub ntsej muag coj los ua ntej koj yuav xav tau software los ua haujlwm rau lub nti. mus rau arduino.cc kom tau txais txoj haujlwm puv ntoob thiab lwm yam piv txwv. cov cai koj pom ntawm no yuav tsum tau theej thiab muab tso rau hauv IDE. int ledPin = 10; byte flicker = {180, 30, 89, 23, 255, 200, 90, 150, 60, 230, 180, 45, 90}; void setup () {pinMode (ledPin, OUTPUT); } void loop () {rau (int i = 0; i, 7; i ++) {analogWrite (ledPin, flicker ); ncua (2000); }} Tam sim no tsuas yog nyem lub pob "upload" thiab hauv ob peb lub vib nas this koj cov arduino yuav khiav txoj cai. Ok nyob rau theem tom ntej kuv yuav piav qhia txoj cai.

Kauj Ruam 3: Cov Khoom Kawg

saib nws yws li cas? qhov ntawd yeej yog qhov chaws ua! Tau txais lus nug? lus pom? kev txhawj xeeb? npe hauv qab no! Yees duab

tsis tuaj yeem cais cov kev xaiv los ntawm: cov ntaub ntawv = "https://www.flickr.com/apps/video/stewart.swf?v=71377" classid = "clsid: D27CDB6E-AE6D-11cf-96B8-444553540000">, {dav: 425, qhov siab: 350

Pom zoo: