Hi, I'm pretty new to arduino and I'm currently trying to make a crossfading RGB LED.
I've written some code but wasn't really happy with it because it was always locked in a while-loop so i looked up and stumbled upon this: http://arduino.cc/en/Tutorial/ColorCrossfader
I read through the code and understood most of it but there is one thing I don't really get:
* In the real program, the color percentages are converted to * 0-255 values, and there are 1020 steps (255*4). * * To figure out how big a step there should be between one up- or * down-tick of one of the LED values, we call calculateStep(), * which calculates the absolute gap between the start and end values, * and then divides that gap by 1020 to determine the size of the step * between adjustments in the value.
Why does he multiply the 255 with 4? I don't really see, why he chose this? Why can't I simply not take 1000 steps? Of course, the crossfading would be a bit faster, but still...
Can someone explain this to me, please?