void setup() {
Serial.begin(9600);
Serial.println("Type your Instruction here..");
for (int thisPin = 2; thisPin < 6; thisPin++) {
pinMode(thisPin,OUTPUT);
}
}
void loop() {
// read the sensor:
if (Serial.available() > 0) {
int inByte = Serial.read();
switch (inByte) {
case 'a':
digitalWrite(5, HIGH);
delay(1500);
break;
case 'b':
digitalWrite(3, HIGH);
delay(1500);
break;
case 'c':
digitalWrite(6, HIGH);
delay(1500);
break;
case 'd':
digitalWrite(7, HIGH);
delay(1500);
break;
case 'e':
digitalWrite(8, HIGH);
delay(1500);
break;
default:
for (int thisPin = 2; thisPin < 9; thisPin++) {
digitalWrite(thisPin, LOW);
}
}
}
}