Have a Question on using RGB Led's......

Help Please!!

I have written code to initiate a number of digital pins with respect to there outputs. As seen below....

int red1 =22; // select the pins for LEDS
int blue1 =28;
int green1 =26;
int violet1 =26 and 28
int yellow1 =24;

The code works and functions great, except I would like to call two integers LOW at the same time for ex: "violet1" which is a color mix of blue1 and green1 so turning these two outputs on at the same time would give me the led color violet. Is there a way to call these outputs LOW at the same time using digitalWrite(violet1, LOW) without effecting the other led color pins?

any help would be greatly appreciated.

Making a class would be the classiest way of doing it. :slight_smile:

This is a pretty good example, it’s for Processing but should be almost directly portable to Arduino.

Fantastic.....thank you!!!