Cov txheej txheem:

LED Tswj: 3 Kauj Ruam
LED Tswj: 3 Kauj Ruam

Video: LED Tswj: 3 Kauj Ruam

Video: LED Tswj: 3 Kauj Ruam
Video: Tswv Yexus lub neej thaum pib txug thaum xaus 2024, Hlis ntuj nqeg
Anonim
LED Tswj
LED Tswj

Txoj haujlwm no yuav siv Arduino Uno micro controller, breadboard, LED's, resistors, thiab potentiometer los tsim cov ntu uas cov potentiometer tswj uas LED's nyob. Raws li lub zog ntsuas hluav taws xob tau tig raws lub moos, "ntawm" LED hloov mus rau sab xis thiab raws li lub zog ntsuas hluav taws xob tau tig rov qab-clockwise, "ntawm" LED hloov mus rau sab laug.

Koj yuav xav tau dab tsi:

- Arduino Ib

- Cov qhob cij

- 5 LEDs

- 5 220 Ohm resistors

- Teb Potentiometer

- Cov xov hlau

Kauj ruam 1: Txuas LED's

Txuas cov LED
Txuas cov LED

Ntxig 5 LED mus rau hauv lub khob cij, txhua qhov sib koom ua ke ib sab, ib qho dhau ib qho. Siv cov xov hlau rau hauv av Led thiab ntxig 220 tus tiv thaiv rau txhua LED. Tom ntej no, siv xov hlau txuas cov LED mus rau Arduino. Txuas cov LED mus rau tus pin raws li ua raws (Koj tuaj yeem siv cov xim LED li cas raws li koj xav tau, tsuas yog txuas lawv tib txoj kev uas kuv muaj hauv daim duab).

Los ntawm sab laug mus rau sab xis:

- Thawj Liab LED rau Digital 12

- Daj LED rau Digital 11

- Ntsuab LED rau Digital 10

- Xiav LED rau Digital 9

- Liab thib ob coj mus rau Digital 8

Kauj Ruam 2: Txuas Potentiometer

Txuas Potentiometer
Txuas Potentiometer

Ntxig lub potentiometer tig rau hauv lub khob cij. Hlau lub hwj chim rau GND thiab 5V raws li daim duab qhia. Tom qab ntawd xaim lub tshuab hluav taws xob mus rau Analog 2 raws li qhia.

Pom zoo: