Arduino Code-
void setup()
{
Serial.begin(9600);
pinMode(9, OUTPUT); // put your setup code here, to run once:
}
void loop()
{ // put your main code here, to run repeatedly:
if(Serial.available()>0)
{ char data= Serial.read();
switch(data)
{ case 'o': digitalWrite(9, HIGH);
break;
case 'f': digitalWrite(9, LOW);
break;
default : break;
}
Serial.println(data);
}
delay(50);
}
Comments