int redpin = 11; //select the pin for the red LED int bluepin = 10; // select the pin for the blue LED int greenpin = 9; // select the pin for the green LED char caracter; void setup() { Serial.begin(9600); pinMode(redpin, OUTPUT); pinMode(bluepin, OUTPUT); pinMode(greenpin, OUTPUT); } void loop() { if (Serial.available()) { caracter = Serial.read(); if (caracter == 'a') { digitalWrite(redpin, HIGH); digitalWrite(greenpin, LOW); digitalWrite(bluepin, LOW); } if (caracter == 'b') { digitalWrite(redpin, LOW); digitalWrite(greenpin, HIGH); digitalWrite(bluepin, LOW); } } }