I am using the terminal app on phone paired with Bluetooth module tied into Arduino. Now when I send one character at a time from phone (get character then hit the send icon on phone) the Arduino understands the characters sent and displays message correctly. But when I send the message as a whole from phone ( type in the message on the text line and then hit the send icon) the Arduino displays junk.
void getMess() // get new message to display
{
i = 0;
selct(2);
while(newMess == true)
{
if(bluetooth.available())
{
ch = bluetooth.read();
bluetooth.print(ch);
switch(ch)
{
case '.' :
Mess[i] = '\0';
i = 0;
newMess = false;
break;
case ' ' :
Mess[i] = ch;
i++;
break;
/* case BS :
ndx--;
break; */
case '\n' :
break;
default :
Mess[i] = ch;
i++;
break;
}
if (i >= NUMCHARS)
i = NUMCHARS - 1;
}
}
}
Any ideas on why this works one way and not the other?
BTW when the arduino sends the 'menu' no problems there.