hi everyone I'm looking for a good alogrithm to send a float variable to a PC by the serial port. First I have to separate the float variable in bytes to be read to send by the serial port. do i have to send the variables in binary or ascii?? what do you recommend me?? Another problem is in the pc.. if I want to use visual basic to print the value how can I join the bytes to have the real float variable?? thanks
"Another problem is in the pc.. if I want to use visual basic to print the value how can I join the bytes to have the real float variable??" No idea! :-( This is a Keil forum, not a Microsoft and/or VB forum - so you'll have to read your VB documentation, visit MSDN, and/or find a VB forum for that one.
Hi, My name is Claudio from Argentina. I had the same problem, but the microcontroller I'm using is a PIC 16F876. What I did was to use this article in the Microsoft Knoledge Base, were I could get the individual bytes of a VB long type variable: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q171652 This same works for single, or double floating point real types, so you can change the individual bytes with the ones received from the UART. I hope this would help.
View all questions in Keil forum