Delay LOW times in pwn RGB Led .

In this sketch I'm trying to get the last color in the sketch, (green) to flash.

Could someone add into this sketch the code to affect the
low times?
It's just goes on 255 right now of course for 500ms, with no 'low' times.

int redPin = 11;
int greenPin = 10;
int bluePin = 9;

void setColor(int red, int green, int blue)
{

analogWrite(redPin, red);
analogWrite(greenPin, green);
analogWrite(bluePin, blue);
}

void setup()
{
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}

void loop()
{
setColor(255, 0, 0);
delay(4000);

setColor(0, 255, 0);
delay(4000);

setColor(0, 0, 255);
delay(4000);
setColor(0,255,0); //I need these to have 100ms LOW Times in between each High time
delay(100);
setColor(0,255,0);
delay(100);
setColor(0,255,0);
delay(100);
setColor(0,255,0);
delay(100);
setColor(0,255,0);

}

Look at 'Blink without delay' example in Arduino IDE Examples .

waski:
Look at 'Blink without delay' example in Arduino IDE Examples .

do you know yet what this function is doing?

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

your code does this over and over...

  setColor(0,255,0);     //I need these to have 100ms LOW Times in between each High time
  delay(100);
  setColor(0,255,0);
  delay(100);
  setColor(0,255,0);    
  delay(100);
  setColor(0,255,0);
  delay(100);
  setColor(0,255,0);

insert one of these to see the GREEN LED turn off:

  setColor(0,255,0);     //I need these to have 100ms LOW Times in between each High time
  delay(100);
  setColor(0,0,0);  //this turns them all off in your function...  255 is max brute, 0 is min.
  delay(100);
  setColor(0,255,0);    
  delay(100);
  setColor(0,0,0);
  delay(100);
  setColor(0,255,0);

So you want the LED to flash on and off at the end?

Use setColor(0, 0, 0) to turn the LED off.

stratovarius:
In this sketch I'm trying to get the last color in the sketch, (green) to flash.

Could someone add into this sketch the code to affect the
low times?
It's just goes on 255 right now of course for 500ms, with no 'low' times.

int redPin = 11;
int greenPin = 10;
int bluePin = 9;

void setColor(int red, int green, int blue)
{

analogWrite(redPin, red);
analogWrite(greenPin, green);
analogWrite(bluePin, blue);
}

void setup()
{
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}

void loop()
{
setColor(255, 0, 0);
delay(4000);

setColor(0, 255, 0);
delay(4000);

setColor(0, 0, 255);
delay(4000);
setColor(0,255,0); //I need these to have 100ms LOW Times in between each High time
delay(100);
setColor(0,255,0);
delay(100);
setColor(0,255,0);
delay(100);
setColor(0,255,0);
delay(100);
setColor(0,255,0);

}