0

I have a bluetooth adapter connected to uno, and using a serial monitor on phone.

In the arduino code im debugging there is this line waiting for new line signal in the serial stream:

char c = SerialBT.read();

if (c == '\r' || c == '\n'){

no matter what i try sending to via my phone i cant get this to evaluate as true...

if i send \n , i believe it is sending it as 2 chars \ and n , not as a single char.

is this a problem with the phone app or what ?

1

It turns out it was a problem with the android terminal program i was using, by switching to another that specifically has support and options for \n \r things it works now.

  • 1
    If you had used third party app terminal, and in EditText field you wrote Hello World\n then yes it will send it as '\' and 'n' because it reads them as chars. – Martynas Apr 3 '15 at 6:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.