Hello, I'm new in this forum. nice to meet you guys.
I try to control an RGB LED from Max. I'm using pin 11, 10, 9 connected to RGB LED and try to fade in/out individual colors from Max GUI. It works fine when it's only one value but how can I send Serial value to 3 different places to control each color individually? my Arduino and Max code is based on the example "dimmer", basically I want to do the same thing with 3 Max faders with RGB LED controlled individually...
'hope that my question is clear.
thanks.
// RGB LED contorolled by SC+Max synths
const int gPin = 11;
const int bPin = 10;
const int rPin = 9;
void setup(){
Serial.begin(9600);
pinMode(gPin, OUTPUT);
pinMode(bPin, OUTPUT);
pinMode(rPin, OUTPUT);
}
void loop(){
byte dimR;
byte dimG;
byte dimB;
if(Serial.available()){
dimR = Serial.read();
dimG = Serial.read();
dimB = Serial.read();
analogWrite(gPin, dimG);
analogWrite(bPin, dimB);
analogWrite(rPin, dimR);
}
}