Cov txheej txheem:
Video: Tswj LED Brightness Nrog Potentiometer Nrog Arduino: 3 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:24
Hauv txoj haujlwm no, peb yuav tswj kev ci ntsa iab ntawm LED siv qhov sib txawv tsis kam muab los ntawm potentiometer. Nov yog txoj haujlwm yooj yim heev rau tus pib tab sis nws yuav qhia koj ntau yam txog potentiometer thiab LED ua haujlwm uas yuav tsum tau ua ua ntej ua haujlwm.
Peb tseem tuaj yeem tswj LED ci ntsa iab yam tsis muaj lub zog ntsuas. nyem qhov txuas hauv qab no txhawm rau txheeb xyuas qhov haujlwm no
txuas: - Coj kev tswj qhov ci ci yam tsis muaj lub hwj chim.
Kauj Ruam 1: Cov Cheeb Tsam Yuav Tsum Tau
- Arduino -
- Potentiometer -
- LED -
- Resistor (220 txog 1000 ohms) -
- Jumper xov hlau -
Kauj ruam 2: Circuit Schematic
Pin 11 coj anode
A0 wiper yog
Vc5v wb
Gnd davhlau ya nyob twg 3 ntawm lub hwj chim, cathode ntawm LED
Kauj Ruam 3: Arduino Code
Arduino analogRead muaj nuj nqi yog siv los ntsuas qhov ntsuas hluav taws xob ntawm 0 txog 5 volts thiab hloov nws mus rau hauv tus lej digital ntawm 0 txog 1023. Qhov laj thawj rau tus nqi 1023 yog vim qhov analog rau digital hloov pauv yog 10-ntsis ntev. Raws li analogWrite ntawm PWM muaj lub luag haujlwm hloov pauv nruab nrab ntawm 0 txog 255 uas yog vim li cas peb yuav faib tus nqi nyeem los ntawm 4 hauv txoj cai.
CODE
const int POTENTIOMETER_PIN = 0;
int analog_value = 0;
void teeb tsa () {
// muab koj cov cai teeb tsa ntawm no, kom khiav ib zaug:
pinMode (11, NTAWV);
pinMode (POTENTIOMETER_PIN, INPUT);
}
void voj () {
// muab koj cov cai tseem ceeb ntawm no, kom rov ua dua:
analog_value = analogRead (POTENTIOMETER_PIN);
// tus nqi ntawm analog_value yog los ntawm 0 txog 1023 thiab lub luag haujlwm ntawm PWM yog 0 txog 255.
analogWrite (11, analog_value/4);
}
Pom zoo:
Tswj LED Brightness Nrog Potentiometer thiab OLED Zaub: 6 Cov Kauj Ruam
Tswj LED Brightness Nrog Potentiometer thiab OLED Zaub: Hauv qhov kev qhia no peb yuav kawm paub yuav ua li cas thiaj tswj tau qhov ci LED nrog lub hwj chim thiab qhia tus nqi ntawm OLED Zaub
Tswj LED Brightness Nrog Potentiometer thiab Arduino: 6 Kauj Ruam
Tswj LED Brightness Nrog Potentiometer thiab Arduino: Hauv qhov kev qhia no peb yuav kawm paub tswj hwm qhov ci ci LED nrog lub hwj chim thiab Arduino
Kho LED Brightness Siv Potentiometer: 4 Cov Kauj Ruam
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.And lub sijhawm no kuv yuav ua kom zoo dua ntawm kev nyeem los ntawm ADC tus nqi.Qhov ntawd yog kho qhov ci ntawm LED
Brightness Control PWM Raws Li Kev Tswj Xyuas LED Siv Push Buttons, Raspberry Pi thiab Kos: 8 Kauj Ruam (nrog Duab)
Brightness Control PWM Raws Li Kev Tswj Xyuas LED Siv Push Buttons, Raspberry Pi thiab Kos: Kuv tau sim nrhiav txoj hauv kev los piav qhia tias PWM ua haujlwm li cas rau kuv cov tub ntxhais kawm, yog li kuv teeb tsa kuv tus kheej txoj haujlwm ntawm kev sim tswj lub teeb ci ntawm LED siv 2 lub laub khawm - ib lub khawm nce qhov ci ntawm LED thiab lwm qhov ua rau nws dimming. Rau qhov
ESP8266 RGB LED Sawb WIFI Tswj - NODEMCU Raws li IR Chaw Taws Teeb rau Led Sawb Tswj Hauv Wifi - RGB LED Sawb Smartphone Tswj: 4 Cov Kauj Ruam
ESP8266 RGB LED Sawb WIFI Tswj | NODEMCU Raws li IR Chaw Taws Teeb rau Led Sawb Tswj Hauv Wifi | RGB LED Sawb Smartphone Tswj: Nyob zoo cov neeg hauv qhov kev qhia no peb yuav kawm paub siv nodemcu lossis esp8266 li IR chaw taws teeb los tswj RGB LED sawb thiab Nodemcu yuav raug tswj los ntawm smartphone dhau wifi. Yog li hauv paus koj tuaj yeem tswj RGB LED Sawb nrog koj lub xov tooj