Is there a way to convert integers into strings? I have two xbees and one is sending text over to the other. But when I use xbee.read and display it on an LCD all I get is numbers. I tried storing the number in an int variable and changing it to a char variable but I am getting characters from an Asian alphabet. Or can someone suggest a better way of accomplishing this? I am using AT mode as an FYI.
void setup() {
Serial.begin(9600);
XBee.begin(9600);
String h = "Waiting For Play";
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print(h);
}
void loop() {
if (XBee.available())
{
int a = XBee.read();
char b = a;
lcd.print(b);
}
}
So when I send Hook it comes out as 188157
In the past when I sent individual characters it came out in decimal form so I just converted them. But I can't find the correlation between 188157 and "Hook"
@PaulS I tried what you said and I put the spaces between them and got the same values. Then I tried sending one letter at a time and the characters were completely off. For "O" I was getting the division sign (not the slash).
@Robin2 thank you! However I tried your sample code and it was printing the question marks with other weird characters. Do you know why that is? Your code worked fine I just couldn't see the correct letters.