Hello everyone, I've only been working with the Arduino for about a week and Processing much less then that. I'm working very hard to teach myself how it all works for a big project I want to do in the future, but I really want to understand it, not just follow tutorials and be satisfied.
Recently I followed a tutorial by Jeremy Blum about controlling the a single color of your screen using a pot and Processing.
I followed it and got it working well, but then I wanted to push it to control RGB color using three pots. I made the Arduino code and got it outputting serial communication stating each RGB value separated by a char.
I'm not sure if I'm going about this in the right way or not but I'm completely stuck on the Processing side. There are a few texts out there about it but they are as clear as mud to me. I just included the base code without trying to read each value, all attempts were major failures.
Any help would be greatly appreciated. Thank you very much.
int RedPotPin = 0;
int GreenPotPin= 1;
int BluePotPin= 2;
int RedVal = map(analogRead(RedPotPin), 0, 1023, 0, 255);
int GreenVal = map(analogRead(GreenPotPin), 33, 972, 0, 255);
int BlueVal = map(analogRead(BluePotPin), 0, 1023, 0, 255);
float brightnessRed = 0;
float brightnessGreen = 0;
float brightnessBlue = 0;
port = new Serial(this, "COM3", 9600);
void serialEvent (Serial port)
brightnessRed = float(port.readStringUntil('G'));
P.S. I know this has no real world application, I'm just trying it to learn.