const int outpin1 = 2; const int outpin2 = 3; void setup() { // put your setup code here, to run once: Serial.begin(9600); //pinMode(outpin1,OUTPUT); //pinMode(outpin2,OUTPUT); } void loop() { // put your main code here, to run repeatedly: if (Serial.available()>0){ char Data=Serial.read(); if (Data=='c'){ // digitalWrite(outpin1,HIGH); Serial.print('y'); } else if (Data=='d'){ // digitalWrite(outpin2,HIGH); Serial.print('z'); } delay(1000); // digitalWrite(outpin1,LOW); // digitalWrite(outpin2,LOW); } }