This is an old revision of the document!
- LED_Fader.ino
int ledPin = 11; int inc = 1; void setup() { // put your setup code here, to run once: pinMode(ledPin, OUTPUT); } void loop() { // put your main code here, to run repeatedly: for (int i=0; i>-1; i=i+inc){ analogWrite(ledPin, i); if (i==255){ inc = -inc; } if (i==0){ inc = -inc; } // if (i==255 || i==0) inc=-inc; delay(2); } }