Hi paul, using strcmp() function if didn't wrong should be result in this way the code ...
if (vw_get_message(buf, &buflen)) // Non-blocking
{
int i;
// Static string that I want to compare
char text_static[2] = {'2','?'};
char text_arrived[buflen];
char msg[1];
digitalWrite(13, true); // Flash a light to show received good message
// Message with a good checksum received, dump it.
Serial.print("Got: ");
for (i = 0; i < buflen; i++)
{
// Received the string and assign to another variable
text_arrived[i] = buf[i], char();
Serial.print(" ");
}
// check the string and do something if are equal ...
if (strcmp(text_static, text_arrived) == 0)
{
// do something
}
I hope is correct ![]()
thanks for the help ![]()