the "fade effect only works both ways with digit 5, any other number, including multiples of 5 cause only a one way fade effect?
Thanks
/
int led =9;
int brightness = 0; //how bright the LED gets.
int fadeAmount = 5; //how many points to fade the LED by.
void setup() {
// setting up the the LED.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever and ever and ever...and ever...:
void loop() {
// set the brightness of pin 9:
analogWrite(led, brightness);
// change the brightness of the LED 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);
}
/