Hi,
Im trying to compare a char thats being received from xbee and if the char is specifc letter then "do something" However Im getting an error of some sort
for (int i = 0; i < rx.getDataLength(); i++)
{
//Serial.print("payload [");
//Serial.print(i, DEC);
//Serial.print("] is ");
if ((i == 2) || (i == 4) || (i == 8) || (i == 10))
Serial.print(" ");
if ((i == 2) || (i == 3))
Serial.print((char)rx.getData()[i]);
if (rx.getData()[i] == "SD")
digitalWrite(led, LOW); // Here is where I am trying to compare whats being received then turning an LED Off
else
Serial.print(rx.getData()[i], HEX);
payload[i] = rx.getData()[i];
}
Serial.println(" ");
}
AGV_Request_Proc(TargetAddr, XB_AGV_Addr_H, XB_AGV_Addr_L);
}
} else if (xbee.getResponse().isError()) {
Serial.print("error code:");
Serial.println(xbee.getResponse().getErrorCode());
}
SerialInput();