Need Help with RGB Diodes


i cant figure out what im doing wrong. im running the arduino RGB tutorial sketch on my arduino uno. it works fine with my RGB diode from “the most complete starter kit”.

T-1 3/4 (5mm) FULL COLOR LED LAMP - Part Number: L-154A4SURKQBDZGC

I bought some more RGB diodes from gearbest webstore and they dont work with the same sketch / hardware setup.

Forward Voltage (V) : 1.9 - 2.1V 3.0 - 3.4V
Maximum reverse voltage: VR 5 (v)
Forward For dc current: 20mA

They nearly have the same specs but dont light up. i tested them in another projects and they are working fine so im sure they are not broken.

What am i doing wrong?

It may be that one LED is common cathode and the other is common anode.

You can prove things out by using a simple resistor and 5v power supply.

What am i doing wrong?

You are not posting links to the original led and the new LEDs. See the forum guide to find out how to post links correctly, so they can be clicked. Part numbers are unique to each supplier, and don’t help us finding the exact component when we don’t know who the supplier is. Descriptions like “the most complete starter kit” have even less meaning.

Thanks for the fast replies!

larryd you are right... the onces not working have common anode. stupid mistake by me. thank you so mutch! is there a way to use PWM with common anode?

For common anode wire them as top LED(s).
The common goes to +5, use 3 resistors.

For common cathode wire them as bottom LED(s).
The common goes to GND, use 3 resistors.

thanks alot! i still have to change the sketch accordingly right? if high value was 255 and low 0 for common cathode i need to change to 0 for high and 255 for low?