Hi,
I`ve some questions to sending different datas over the uart:
01.) integer (0x41) = tostring$(65) --> how can I managed to get a "A" in the string? How is the way to go back("A" --> 65)?
02.) I send a string "hello" and additional a char(13). In the receiver I use the receive string component with one letter and put the single letters together in a new string.
Background is to check the incoming char(13). How can I managed this?
03.) str1 = numbertohex$(123) shows in the debugger "0x"?
Best regards
Jörg
strings/char converting --> uart problem
-
- Posts: 77
- Joined: Wed Jun 22, 2011 3:32 pm
- Has thanked: 17 times
- Been thanked: 11 times
strings/char converting --> uart problem
- Attachments
-
- Strings_Uart.pdf
- (19.35 KiB) Downloaded 479 times
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: strings/char converting --> uart problem
A string is an array of bytes,
So for example you can place an A as the first character in the string with any of these
Similarly, if you want to look for a carriage return in a string you can compare with 13
It looks like your string length for str3 is not large enough
StringToInt$() expects the string to be a valid number
Hope that helps,
Leigh
So for example you can place an A as the first character in the string with any of these
Similarly, if you want to look for a carriage return in a string you can compare with 13
It looks like your string length for str3 is not large enough
StringToInt$() expects the string to be a valid number
Code: Select all
str2 = "100"
int2 = StringToInt$ (str2)
Leigh