RBG LED Spectrum Problem

Hi friends,

I am using Teensy 3.0. My wiring is correct.
I am trying to create a Spectrum with 4 - pin RBG LED.

My code don't work. Kindly assist.

My Code :

const int redPin = 6;
const int greenPin = 3;
const int bluePin = 5;
const int pwmpin = 9;

void setup() {
// Start off with the LED off.
setColourRgb(0,0,0);
}

void loop() {
analogWrite(pwmpin, 1023);
unsigned int rgbColour[3];

// Start off with red.
rgbColour[0] = 0;
rgbColour[1] = 0;
rgbColour[2] = 0;

// Choose the colours to increment and decrement.
for (int redColour = 0; redColour < 255; redColour++)
{
for (int greenColour = 0; greenColour < 255; greenColour++)
{
for (int blueColour = 0; blueColour < 255; blueColour++)
{
rgbColour[0] = redColour4;
rgbColour[1] = greenColour
4;
rgbColour[2] = blueColour*4;
setColourRgb(rgbColour[0], rgbColour[1], rgbColour[2]);
delay(5000);
}
}
}
}

void setColourRgb(unsigned int red, unsigned int green, unsigned int blue) {
analogWrite(redPin, red);
analogWrite(greenPin, green);
analogWrite(bluePin, blue);
}

Define "doesn't work". What should it be doing, and what is it doing?

First, analogWrite only works with 8-bit values, 0-255. Looks like you're trying to write 10-bit values, 0-1023.

If there's another problem, I don't know because you haven't told us the problem.

Are you trying to PWM on all four of the LED pins?

Is it common cathode or anode?

Perhaps you should not assume that your wiring is "correct".