Color Sensing with TCS3200, Need Help with Code & Understanding

Johan_Ha:
You have correct values in the termina? Just write them with analogWrite() to the right LED pins. Not digitalWrite().

Yeah, the terminal has the correct RGB values. They show up as:

R= 104 G= 124 B= 142
R= 98 G= 124 B= 148
R= 104 G= 124 B= 142
R= 98 G= 124 B= 176

They're constantly changing because every 300(ms?) the loop runs again or whatever. And thats what I want it to do.

What I'm stuck on is getting these values to write to the LED dynamically, I guess? (So if I just analogwrite the first set of RGB number, it will just stay at those. I dont want that, I want it to write to the LED in the same way its writing to the terminal, if that makes sense).

I made a function for it, that uses analogwrite, but I'm not sure what arg to pass into it.

void LEDColor(int v1, int v2, int v3) {
  analogWrite(RGBLEDR,v1);
  analogWrite(RGBLEDG,v2);
  analogWrite(RGBLEDB,v3);
  
}[b][/b]

It's been a few years since I did any programming, so I appreciate the help.

v1,v2,v3 are the RGB values that get displayed in the terminal. Just not sure what argument to pass into the function to actually do that. I know I need to take the RGB values that are shown in the terminal and put them on the LED.