androidthings / sample-uartloopback

Echo received characters over a UART with Android Things
Apache License 2.0
78 stars 39 forks source link

Random code problem #10

Closed fail572872916 closed 5 years ago

fail572872916 commented 5 years ago

I want to input the content I input in aruino at Log, but there is a garbled problem and how to solve it. tim 20181105160538 tim 20181105160635

Fleker commented 5 years ago

Can you print out the character codes of each character? My guess, from looking at this, is that you're reading in a ton of characters at a time, more than the sending device is sending. As such, it is going to read in one character and leave the rest as nulls (character code '0').

Keep in mind the data types you're passing back and forth. If your Arduino is sending numbers, you should be looking at the numbers coming back and not the associated characters.

fail572872916 commented 5 years ago

I have solved this problem. tim 20181106114153 Thank you for your project.