Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

How to different data from micrcontroller?

i'm trying to communicate with a microcontroller which is connected to IR. IR using the AT command. the problem is the data from the microcontroller is in binary from while the AT command is in character form... to simplfy. Consider the example below,

i want to send value 65 to computer from microcontroller... at the meanwhile character "A" is ascii also represent 65. How to differentiate value 65 and character "A".

What is the method normally used? really need help... :(
[501 byte] By [speedss] at [2007-11-11 10:17:42]
# 1 Re: How to different data from micrcontroller?
A byte is a byte; there is no difference between the byte 65 and the character 'A'. If you send the character 'A' to the microcontroller, it will "hear" 65.

If you'd like it to be obvious in your code that you're sending the value 65, you may use the Chr function:

ValueToSend = Chr(65)

This is equivalent to:

ValueToSend = "A"
Phil Weber at 2007-11-11 17:22:49 >
# 2 Re: How to different data from micrcontroller?
My microcontroller send out the temperature value, let say 65(which is 1000001 in binary form and NOT in character form where 65 is equal to chr(54) & chr(53) )

And my IR which is connected to the serial port will send some AT Command which in character form.

So, i am having problems in differentiate whether the receiving data is a character or a decimal.

what should i do?
speedss at 2007-11-11 17:23:49 >