Cov txheej txheem:

Kho LED Brightness Siv Potentiometer: 4 Cov Kauj Ruam
Kho LED Brightness Siv Potentiometer: 4 Cov Kauj Ruam

Video: Kho LED Brightness Siv Potentiometer: 4 Cov Kauj Ruam

Video: Kho LED Brightness Siv Potentiometer: 4 Cov Kauj Ruam
Video: Штукатурка стен - самое полное видео! Переделка хрущевки от А до Я. #5 2024, Hlis ntuj nqeg
Anonim
Kho LED Brightness Siv Potentiometer
Kho LED Brightness Siv Potentiometer

Hauv tsab xov xwm dhau los, kuv tau qhia koj yuav ua li cas nyeem ADC tus nqi los ntawm Potensometer siv Arduino.

Thiab lub sijhawm no kuv yuav ua kom zoo dua ntawm kev nyeem los ntawm ADC tus nqi.

Qhov ntawd yog kho qhov ci ci ntawm LED.

Kauj Ruam 1: Cov Cheeb Tsam Xav Tau

Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam

Cheebtsam uas yuav tsum tau npaj:

Arduino Nano Cov

Jumper Hlau

Potentiometer

Kev tiv thaiv 1K

Xiav LED

Pawg phiaj xwm

USB mini tso

Laptop

Kauj Ruam 2: Sib Sau Ua Ke Txhua Yam

Sib Sau Ua Ke Txhua Yam
Sib Sau Ua Ke Txhua Yam
Sib Sau Ua Ke Txhua Yam
Sib Sau Ua Ke Txhua Yam

Saib daim duab saum toj no rau phau ntawv qhia kev sib dhos, Arduino rau Component

A0 ==> 2. Potentiometer

GND ==> 1. Potentiometer & Katoda LED

+5V ==> 3. Potentiometer

D3 ==> Resistor series nrog leds

Kauj ruam 3: Programming

Programming
Programming

Luam cov cai hauv qab no rau koj daim duab:

int LED = 3;

void teeb tsa () {

pinMode (LED, NTAWV); Serial.begin (9600); }

void voj () {

int sensorValue = analogRead (A0)/4;

analogWrite (LED, sensorValue); }

kos duab hauv daim ntawv ntawm thawj daim ntawv, tuaj yeem rub tawm ntawm no:

Kauj Ruam 4: Qhov tshwm sim

Saib cov vis dis aus saum toj no kom pom cov txiaj ntsig.

Thaum lub potentiometer tig mus rau sab xis, cov coj yuav ci dua.

Thaum lub potentiometer tig mus rau sab laug, LED yuav dimmer.

Pom zoo: