I have this
image which describes the cables I've "attached" to my Arduino Mega to control an RGB LED.
I get something very strange:
when I writeanalogWrite(RED, 0)
the LED becomes red and not set the RED component of the color to 0.
I'm a bit confused...
If I writeanalogWrite(RED, 255)
the LED turn itself off.
(in these examples, the others colors are set to 0. Really.... 0. They are not visible).
I have an Arduino Mega and I've connected the RED to 8, GREEN to 9 and BLUE to 10 and Ground to 5V port.
What is the mistake?
Thanks a lot!