Hi.
I've got an rgb led. I also have a load of switched attached to my PIC. Each switch has a colour associated with it.
The colours will be:
When I turn on the red switch i want the rgb led to shine red. Then when i turn off the red switch, and turn on the blue switch I want it to shine blue. Not tricky right?
Here's where it gets tricky, if i turn on the red switch and the blue switch, I want it to shine pink because both of this colours are effectively "On". If i were to turn on the green switch then I should get a white light since the red green and blue switches are on.
Later on this project will get even mire complicated where there will be switches for other colours like turquoise.
The basic principle is that the rgb displays and mixes light depending on what colour switches are turned on.
I understand that PWM will be used to change the colour of the lights. However I'm stuck on two things:
1. How can I work out what colour should be displayed based on which colour switches are on.
2. How can i change this colour into an RGB percentage, therefore what percentage should red be on, what percentage should green be on and what percentage should blue be on.
Sorry for the long post but I don't know where to start with this.
James
I've got an rgb led. I also have a load of switched attached to my PIC. Each switch has a colour associated with it.
The colours will be:
Red. : 100% Red, 0% green, 0% blue
Green : 0% Red, 100% green, 0% blue
Blue : 0% Red, 0% green, 100% blue
Yellow : 50% Red, 50% green, 0% blue
Pink : 50% Red, 0% green, 50% blue
Turquoise : 0% Red, 50% green, 50% blue
When I turn on the red switch i want the rgb led to shine red. Then when i turn off the red switch, and turn on the blue switch I want it to shine blue. Not tricky right?
Here's where it gets tricky, if i turn on the red switch and the blue switch, I want it to shine pink because both of this colours are effectively "On". If i were to turn on the green switch then I should get a white light since the red green and blue switches are on.
Later on this project will get even mire complicated where there will be switches for other colours like turquoise.
The basic principle is that the rgb displays and mixes light depending on what colour switches are turned on.
I understand that PWM will be used to change the colour of the lights. However I'm stuck on two things:
1. How can I work out what colour should be displayed based on which colour switches are on.
2. How can i change this colour into an RGB percentage, therefore what percentage should red be on, what percentage should green be on and what percentage should blue be on.
Sorry for the long post but I don't know where to start with this.
James