// E4.6 const int redPin = 3; const int greenPin = 6; const int bluePin = 5; void setup() { Serial.begin(9600); pinMode(redPin, OUTPUT); pinMode(greenPin, OUTPUT); pinMode(bluePin, OUTPUT); } void loop() { while (Serial.available() > 0) { int red = Serial.parseInt(); int green = Serial.parseInt(); int blue = Serial.parseInt(); red = constrain(red, 0, 255); green = constrain(green, 0, 255); blue = constrain(blue, 0, 255); analogWrite(redPin, red); analogWrite(greenPin, green); analogWrite(bluePin, blue); Serial.println(red); Serial.println(green); Serial.println(blue); } }