Hello
Wanted to make a pumpkin light with the arduino using RGB leds, after getting insperation from Project 9 of Earthshine Design Arduino Starter Kit Manual (download if you have not...is brilliant)
truble is this code is for 2xyellow, and 1xRed leds...and i have no yellows
Soooooo was wondering if someone could help me with changing the code to have one of the RGB set as yellow, and one set as Red.
// Project 9 - LED Fire Effect
int ledPin1 = 9;
int ledPin2 = 10;
int ledPin3 = 11;
void setup()
{
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
}
void loop()
{
analogWrite(ledPin1, random(120)+135);
analogWrite(ledPin2, random(120)+135);
analogWrite(ledPin3, random(120)+135);
delay(random(100));
}
AND THEN!!!!!!!!!
what would be really cool is to have them flickering for 30 seconds ten both switch to a spooky bright green for 5 and loop!
So far iv got....this mess
// RGB Flames
int ledPin1 = 3; // R
int ledPin2 = 5; // G
int ledPin3 = 6; // B
int ledPin4 = 9; // R
int ledPin5 = 10; // G
int ledPin6 = 11; // B
void setup()
{
pinMode(ledPin1, OUTPUT); // R
pinMode(ledPin2, OUTPUT); // G
pinMode(ledPin3, OUTPUT); // B
pinMode(ledPin4, OUTPUT); // R
pinMode(ledPin5, OUTPUT); // G
pinMode(ledPin6, OUTPUT); // B
}
void loop()
{
analogWrite(ledPin1, random(120)+135); // RED
analogWrite(ledPin4, random(120)+135); // RED (red + green =YELLOW
analogWrite(ledPin5, random(120)+135); // GREEN (green + red = Yellow)
delay(random(100));
}
The trouble is I will need the pin4 (red) + pin5 (green) to flicker at the same rate to keep a constant yellow huge... :o