Asked — Edited

Rgb Led Help Needed

Hi everyone, im having a great deal of trouble trying to sync 2 of the RGB leds i have for my robots eyes.

Just spent the last 2hrs, and some other days trying to get them to sync, so i thought it best i turn the ezb off and ask for assistance because its greatly delaying my current project...and meanwhile giving me zero confidence to start the next project for if i can't sync 2 leds... tired

Ive been close with it, but then they stray off and start to do their own thing, no matter what i do i just can't get them to join in holy matrimony.

Any help would be greatly appreciated, ive spent around 3-4 hrs total trying to figure it out as embarrassing as it is for me to say..and the more i try it seems to all go backwards and becomes much worse than when i started.


ARC Pro

Upgrade to ARC Pro

Subscribe to ARC Pro, and your robot will become a canvas for your imagination, limited only by your creativity.

#9  

edited to remove incorrect information. My info matched Jeremie's diagram, but not your's, and I had my cathode and anode terms mis-matched.

@PTP is correct, as usual.

Alan

PRO
USA
#10  

There 2 types of rgb leds:

  1. common anode common anode to the vcc (use the 3.3 regulated red pin) 3 x cathodes to the digital pins led will light on Low/ON

  2. common cathode common cathode to the gnd (black pin) 3 x anodes to the digital the led will light on High/OFF

Your led is type 1) Jeremie is type 2)

PRO
USA
#12  

FUD detected !

@thetechguru

Quote:

Common Anode = Ground - goes to the ground pin of any digital port.

Not correct Anode is Positive goes to a Positive +

@Nomad 6R

Quote:

D23 common anode is black pin

wrong also the picture is confusing both red and black ?

PRO
USA
#13  

Common Anode connections:

The led pcb has 4 pins like RGB Led Common Anode: Red (Cathode) Green (Cathode) Blue (Cathode) 5v (Common Anode) Purple cable

User-inserted image

Purple Cables (Common Anodes) are connected to regulated 3.3v (Analog Pins Bank):

User-inserted image

RGB Cathode Pins are connected to the digital pins:

User-inserted image

PRO
USA
#14  

*** Common Anode RGB LED ***

Notes: ON = LED OFF OFF = LED ON PWM 1 or OFF = Max Brightness PWM 99 = Min Brightness


# rgb 1 led pins
$rgb1_red=0
$rgb1_green=1
$rgb1_blue=2

# rgb 2 led pins
$rgb2_red=4
$rgb2_green=5
$rgb2_blue=6

# ---- ON / OFF ----

# red led is off (common anode)
set($rgb1_red, on)

# green led is on (common anode)
set($rgb1_green, off)

# bluee led is on (common anode)
set($rgb1_blue, off)

# ---- Brightness (PWM) ----

# red led max brightness (common anode)
pwm($rgb2_red, 1)

# green led mid brightness (common anode)
pwm($rgb2_green, 50)

# blue led min brightness (common anode)
pwm($rgb2_blue, 99)

# ---- RGB colors PWM ----

#orange
pwm($rgb1_red, 100-99)
pwm($rgb1_green, 100-64)
pwm($rgb1_blue, 100-0)

#indigo
pwm($rgb1_red, 100-29)
pwm($rgb1_green, 100-0)
pwm($rgb1_blue, 100-50)

#brown
pwm($rgb2_red, 100-64)
pwm($rgb2_green, 100-16)
pwm($rgb2_blue, 100-16)

indigo and brown lights, no doubts:) :

User-inserted image

PRO
Belgium
#15  

php

i mean red&black on ezb.thank for the pics.i would love to have tri color, led whit flat head.

PRO
USA
#16  

@Nomad 6R

Quote:

i mean red&black on ezb.t

One or the other, and there are 3 types of voltages: VIn (Red) VCC (Red) GND (Black)

For common Cathodes Led: you connect the common (4 leg) to the GND(Black)

For common Anode Led: you connect the common (4 leg) to the VCC (red) Digital Pins's VIn (red) is not regulated we need the VCC (red) 3.3v from the analog bank.