I am currently sending data via my bluetooth and to it I send with me 4 different values looking like this:
byte[] myByte = {"HelloOne", "HelloTwo", "HelloThree", "HelloFour"};
WriteAsync(myByte);
And now I am looking for a way to store all these Hello's in different values.
What I have started with is something like this:
if (Bluetooth.available())
{
while (true)
{
delay (50);
char c = Bluetooth.read();
readString += c;
if (readString.length() >0) {
if (readString[0] == "HelloOne")
{
Serial.println ("Hello One has been sent!");
}
if (readString[1] == "HelloTwo")
{
Serial.println ("Hello Two has been sent!");
}
if (readString[2] == "HelloThree")
{
Serial.println ("Hello Three has been sent!");
}
if (readString[3] == "HelloFour")
{
Serial.println ("Hello Four has been sent!");
}
}
}
}
And I have not actually been able to debugg (not currently at home but eager to get to fix this problem asap) so there is a slim chance that my current code might be working? Very unlikely though.
So my question is, what is the correct way to get each value out in a byte array that is being sent with bluetooth to arduino?