int relay = 13;
char input;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(relay, OUTPUT);
Serial.print("Y: on, N:off");
}
void loop() {
// put your main code here, to run repeatedly:
input = Serial.read();
if(input == 'Y'){
digitalWrite(relay, HIGH);
}
if(input == 'N'){
digitalWrite(relay, LOW);
}
}