String valFromKbd;
int buzzPin =27;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(buzzPin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if (Serial.available() > 0){
valFromKbd=Serial.read();
Serial.println(valFromKbd);
}
if(valFromKbd=="ON"){
digitalWrite(buzzPin, HIGH);
}
if(valFromKbd =="OFF"){
digitalWrite(buzzPin,LOW);
}
}