Arduino | How to make a LED Dimmer using 2 Push Buttons | FULL TUTORIAL | For Beginners 2020

preview_player
Показать описание
In this Tutorial you will learn on how to dim a LED using 2 Push Buttons, It is very easy. Full Programming Tutorial was on the video.

For more Tutorials :
Please Like and Share and don't forget to subscribed to my channel! thank you!
Рекомендации по теме
Комментарии
Автор

this is great been working on it for almost 3hours but you made it so easily thanks sir.

playlikeaman
Автор

Sir this is very good 👍 code can I control this led with Lora HC-12 modules wireless please answer me

dice
Автор

Thank you for this video, very good and clear!

lyrics_channel
Автор

why LED glows dimmer when i pressed the 2 pushbuttons together??

lesterlozano
Автор

Can you please share the code.
Thanks & kind regards

yawarsaeed
Автор

Hello. Thank you so much for sharing this useful and detailed informations with us.

const int LED =3;
const int BUTTON1 =4;
const int BUTTON2 =5;

int button1, button2, dim_value;

void setup() {
pinMode(BUTTON1, INPUT);
pinMode(BUTTON2, INPUT);
pinMode(LED, OUTPUT);
}

void loop() {

button1 = digitalRead(BUTTON1);
button2 = digitalRead(BUTTON2);

if(button1 == HIGH) {
if(dim_value > 255) {
dim_value = dim_value;
}
else{
dim_value += 25;
delay(300);
}
}
if(button2 == HIGH) {
if(dim_value < 25) {
dim_value = dim_value;
}
else{
dim_value -= 25;
delay(300);
}
}
Serial.println(dim_value);
analogWrite(LED, dim_value);
}

abidinakdag