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(greenpin, OUTPUT); pinMode(bluepin, OUTPUT); digitalWrite(redpin, 0); digitalWrite(greenpin, 255); digitalWrite(bluepin, LOW); } void loop() { if (Serial.available()) { caracter = Serial.read(); if (caracter == 'a') { digitalWrite(redpin, 255); digitalWrite(greenpin, LOW); digitalWrite(bluepin, LOW); } if (caracter == 'b') { digitalWrite(redpin, LOW); digitalWrite(greenpin, 255); digitalWrite(bluepin, LOW); } } }