Add the following snippet to your HTML:
Hello all, in this project I will show you how to build fading LED project
Read up about this project on
// C++ code // int led =6; int brightness =0; int fadeAmount =5; void setup() { pinMode(led, OUTPUT); } void loop() { analogWrite (led, brightness); brightness= brightness + fadeAmount; if (brightness <=0 || brightness >=255){ fadeAmount =-fadeAmount; } delay(30); }
Comments