Cov txheej txheem:

LED Kab Fade Arduino: 4 Kauj Ruam
LED Kab Fade Arduino: 4 Kauj Ruam

Video: LED Kab Fade Arduino: 4 Kauj Ruam

Video: LED Kab Fade Arduino: 4 Kauj Ruam
Video: ESP32 Tutorial 5 - LED Fade, control brightness of an LED -ESP32 IoT Learnig kit 2024, Kaum ib hlis
Anonim
LED Kab Fade Arduino
LED Kab Fade Arduino

Txog qhov haujlwm no kuv tau tsim kab LED ploj ntawm sab laug mus rau sab xis, raws li txoj haujlwm ntawm lub hwj chim.

Cov ntaub ntawv xav tau yog:

1) Arduino Uno

2) Daim ntawv qhia zaub mov

3) 5 LEDs xiav

4) txiv neej rau txiv neej jumper xov hlau

5) potentiometer

6) 5 220ohm resistors

Kauj Ruam 1: Txuas Lub Hwj Chim

Txuas Lub Hwj Chim
Txuas Lub Hwj Chim

Txuas koj cov xov hlau raws li qhia hauv daim duab no. Nws yog ib qho tseem ceeb heev uas koj siv lub zog 5v kom lub ci ci ntawm LEDs yuav ua haujlwm kom raug. Hauv av tau siv rau txhua lub LEDs thiab lub zog ntsuas hluav taws xob, thaum lub zog tsuas yog siv rau lub zog ntsuas. Cov LEDs yuav txuas nrog lub khob cij.

Kauj Ruam 2: Txuas cov LEDs

Txuas cov LEDs
Txuas cov LEDs

Txuas cov LEDs raws li qhia hauv daim duab saum toj no. Nco ntsoov tias anode txuas nrog tus tiv thaiv thiab arduino. Cov anode yog lub zog kawg (qhov ntev kawg), thiab cathode yog hauv av (qhov luv dua). Nco ntsoov tias LEDs txuas nrog Arduino raws li qhia. Lawv txhua tus txuas nrog PWM tus pin kom qhov ci ci tuaj yeem hloov pauv.

LED1 => PWM pin 11

LED2 => PWM pin 10

LED3 => PWM pin 9

LED4 => PWM pin 6

LED5 => PWM pin 5

Kauj Ruam 3: Txuas Potentiometer

Txuas Potentiometer
Txuas Potentiometer

Lub potentiometer yuav tsum txuas nrog ib yam li daim duab qhia. Tus pin siv rau nws yuav tsum yog analog 2, vim tias lub hwj chim muab cov tswv yim sib piv.

Kauj ruam 4: CODE

Nov yog cov cai rau teeb tsa. Yog tias koj hloov dab tsi hauv txoj cai, nco ntsoov tias cov pins tseem kab.

Pom zoo: