I am trying to write a long variable in Mikro C pro, say 991245
its splitting in to four char (from LSB to HSB) as 0D 20 0F 00 in Hex.
problem is instead of writing 0D its printing new line. Because of carriage return setup on UART_Write(13) .
How to stop this or change the carriage return value 13 to something else.
To send a long (4-byte) variable to UART first convert it to a HEX string then send out the result string. To do this use the LongWordToHex library function (for example).
See the help:
Miscellaneous Libraries > Conversions Library > LongWordToHex
Hello
Your program in the controller can send date like 0x0d, 0x0a ... It's the programme on your PC for example who need to interprete the data as a data, not as a command.
For this yoou can use escape character. The data can also be a command must be preceded by a special character. And if the data is to be transmitted this character, and well it should be also preceded by the escape character.