Problem with arduino Duemilanove!! HELPPP

I am doing a mood light project where i am programming 4 rgb leds to light in colors red, blue, aqua, pink , green and yellow. In order for yellow to light up, green and red are combined. What i noticed is that when i connect the arduino board to the computer green and yellow colors are the only colors that wont appear. Connection is correct , and components are alright. I am not sure if programming has something wrong. what might be the problem?

This is the code btw:
int redPin = 11;
int greenPin = 8;
int bluePin = 9;

void setup()
{
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}
void loop()
{
setColor(255, 0, 0); // red
delay(1000);
setColor(0, 255, 0); // green
delay(1000);
setColor(0, 0, 255); // blue
delay(1000);
setColor(255, 255, 0); // yellow
delay(1000);
setColor(80, 0, 80); // purple
delay(1000);
setColor(0, 255, 255); // aqua
delay(1000);
}
void setColor(int red, int green, int blue)
{
#ifdef COMMON_ANODE
red = 255 - red;
green = 255 - green;
blue = 255 - blue;
#endif
analogWrite(redPin, red);
analogWrite(greenPin, green);
analogWrite(bluePin, blue);
}

Your greenPin using pin 8 was not a PWM pin will not work with analogWrite()

At first i had it on PWM10 and it didnt work either :frowning:

Please post a picture show us how you connect up.

Is that picture okay? What i was thinking right now is that the rgb leds i am using are 6 pin ones since they have two blue leds in them.. however i only connected up one blue. Would that be the problem?

IMG_2213[2].JPG

Your green wire connected to a resistor but the other end of resistor was open.

You are saying the RGB LEDs you are using are 6 pin.
Is it
Three cathodes, three anodes? Basically, three separate LEDs in one enclosure?

or

1 anode Red
2 anodes Blue
1 anode Green
2 common cathodes

1 anode Red
2 anodes Blue
1 anode Green
2 common cathodes

Here you can find the technical sheet of what i ordered..

That is not the problem i think because i tried connecting all blues and run the code consisting of the two blues perfectly but green still dint light up.
I even tried to reduce LEDS to only two and maximise the current in case green lighted up but not brightly enough to see it but unsurprisingly it didnt work either..
And i connected the green resistor to the ground on the open edge like i did to all the rest as you recommended but still..

Actually I would be really interested but I dont have time. This is a project i am preparing for university and i have to present it in two days time! I find lights and all things around them really interesting and despite the fact that we havent been taught arduino yet i attempted to do that. SO if it worked great that would be more than enough for me now! Hope the photo is ok now..! Fill me in i f not :slight_smile:

IMG_2240[1].JPG

I will try that! Thank you! :slight_smile:

raschemmel !

An avatar is an avatar. Please do not assume gender from the photo. Gail Shaw, who is a very active participant on SQL forums, is female, but as an avatar has some male character from the Star Wars trilogy.

I am sorry but the topic of this forum was not my person but the problems i am facing! As i said my LEDs have 6 pins and what you said couldnt be done since A-E and F-J consist of 5 letters therefore 5 holes! I do have a schematic and i am glad you are surprised.. also my wiring is good since i connected the two breadboard sections with a wire and connected each pin of the rgb to the terminal! I might be 19 and since i am first year in university and never really done anything around arduino or rgb's it should be respected that i am trying myself to do something different and learn on my own. I asked for help and not offences! Glad you have some knowledge around electronics because in respecting women you have none! My personal life is none of your business and you have issues go solve them yourself.

Some people on the forum may indeed have a problem with dealing with intelligent women but not all. But on the other hand it is not unknown for some people to portray themselves as the fairer sex in order to elicit a more sympathetic response.

"The lady doth protest too much, methinks."

Try as I might , I am unable to feel guilty. Why ? Well, let's look at the facts. What exactly did I say ? I suggested that the reason your circuit looked the way it did was because you were busy partying instead of building circuits. I don't know what country you are in but I can tell you for a fact that in the USA, if your 19 , the only reason you would not be going to parties is because you weren't invited.
That's what 19 year olds do. Simple fact. I can only think of a few countries where that might not be true, Saudi Arabia for one, and the countries that have a very strict religeous or cultural rules. In all the other countries, when Friday rolls around the one question every normal 19 year old is asking everyone is "where are the parties?" So if you are offended by me suggesting that you are normal, then I don't know what to say , but I am not going to apologize for that. If on the other hand, you are offended by me suggesting that you were going to parties instead of building circuits, then , well, I guess I would have to say you need to learn to recognize a joke when you see it. Humor is not a sin, any more than going to parties when your 19. Both of them are part of the process of integration into society when you come of age. In order to interact with others of any age , one needs to understand concepts like humor. As far as what I said about not bending the leads, I stand by that. If the led has too many leads to fit into the breadboard, the correct course of action is not to bend the leads all out of shape , but to get some 22 guage insulated hookup wire and solder short section of wire 1 to 2 inches long to each lead of the led and insulate each lead with heatshrink. That is how it is done by professionals in electronics. Bypassing that step, because it is too much work is just asking for trouble and risking breaking a lead on a led. If you extend the leads that way , you can put them whereever you want. Also, when it comes to wiring breadboards there are only two accepted methods. The preferred one for arduino hobbyist is to buy the sheathed hookup jumpers you see in all the tutorials. Why you did not do that I cannot imagine . They are readily available and not that expensive. The second method , if you don't have those factory made jumpers , is too cut the wires so they are just long enough when you lay them down flat with right angle bends. This is the method you should have used since you obviously did not buy the jumpers.
If you lay the wires down flat, you can see where the wires go in a photo and the circuit looks clean. Saying that your circuit is wired correctly electrically does not mean it is wired correctly. If you used a meter on resistance range and used a couple of short pieces of wire , you could ohm out your circuit and check the continuity of the GREEN led lead to whereever it is supposed to be connected. I did not see anything in your post to suggest you did that. This is step number 1 in troubleshooting circuits. Alternately, if you suspected a poor connection on the breadboard you could get micro-hook jumpers or just twist a piece of wire on the RGB led grn and cathode leads and test it outside the circuit using only power and no software. I didn't see anything in your post to suggest that you did that. My gut feeling is that building the circuit was such a pain that once you got it built you did not want to tear it apart so rather than remove the led and test it outside the breadboard without software, you left it in and tried to troubleshoot it that way. There are only three possibilities , all of which you could have verified. Either the led is damaged (unlikely) or it is not wired correctly, or it is not making contact to the wire. Attempting to test it with software that may or may not be correct is just a waste of time . You need to eliminate the software as possible cause, and eliminate the breadboard connections as a possible cause and narrow it down to "is the device damaged or not ?

I have look through your posted pics and I have found that you have wired the LED the wrong way like this.

This way the resistor will not limit the current for the LED and your will damage your Arduino out put pin.
The resistor have to be in series with the LED in the circuit.
The correct way to wired your LED will be like this

In-case you have miss the BreadBoard connection will look like this

I was unable to find a "surfboard" for the 6-pin RGB leds but I did find a solution that allows the pins to be wired without bending them. The following link is for a small through-hole protoboard (Catalog #: 276-148) with pads on every hole. The pin spacing is the compatible with the RGB LEDS. The board can be sectioned into small 1"x1" squares with a hacksaw or table scroll-The led can be inserted into the PCB and the connection wires and be soldered to the extruding pins on the back-side and then trimmed short after soldering. This would allow the RGB leds to mounted securely without any bending of pins. The board cost $3.

I would recommend 24 guage stranded wire for this connection with 1" pieces of 22 guage solid copper wire soldered to the ends of the cable to plug into the breadboard.