filmov
tv
LED fade in / out program by using arduino UNO | Embedded C program | Basic LED program

Показать описание
#arduinobasicprogram #arduinoLEDfadeinfadeoutprogram #arduinounoprogram #arduinoprogram
Hi Guys,
In this video we are going to see about LED fade in /fade out basic program by using Arduino UNO.
If you are having any doubt regarding this pls comment in the comment window.
For arduino IDE installation:
PROGRAM :
int led = 11; //Pin 11
int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by
void setup() {
// put your setup code here, to run once:
pinMode(led, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
analogWrite(led, brightness);
// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;
// reverse the direction of the fading at the ends of the fade:
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
// wait for 30 milliseconds to see the dimming effect
delay(30);
}
Hi Guys,
In this video we are going to see about LED fade in /fade out basic program by using Arduino UNO.
If you are having any doubt regarding this pls comment in the comment window.
For arduino IDE installation:
PROGRAM :
int led = 11; //Pin 11
int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by
void setup() {
// put your setup code here, to run once:
pinMode(led, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
analogWrite(led, brightness);
// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;
// reverse the direction of the fading at the ends of the fade:
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
// wait for 30 milliseconds to see the dimming effect
delay(30);
}