I am using an LED Bluetooth control using the code below. The program currently accepts only single characters. I have looked up other solutions but haven't been able to relate it to my code. Can you tell me how I can accept a string instead of single characters?
char data = 0;
void setup()
{
Serial.begin(9600);
pinMode(13, OUTPUT);
}
void loop()
{
if (Serial.available() > 0)
{
data = Serial.read();
Serial.print(data);
Serial.print("\n");
if (data == 'a')
{
digitalWrite(13, HIGH);
}
else if (data == 'b')
{
digitalWrite(13, LOW);
}
}
}