Fading LED is not a Tough or critical Project but its application are very important. my means we can control LED for decoration lights and we can use same application for to control BJT conduction level unconditional as well conditional which's useful in some other projects. We can control the speed of DC motor also.
Circuit diagram:
//
www.Elekronicsgarage1.blogspot.com //
int
ledPin = 9; // LED connected to PWM
based digital pin 9
int
fadval = 0; // fading start value
void
setup() {
// nothing something in setup
}
void
loop() {
// I am fading from mini to max
for (fadval = 0 ; fadval <= 255; fadval
=fadval+5) // Start from; max; increasing step
{
analogWrite(ledPin, fadval);
delay(50); // delay of 50ms in dimming
effect
} }
If you like my post then share and like it
and if you have any question then comment me
No comments:
Write commentsI am very thankful for your precious time