Thread: Send Byte
View Single Post
  #10   Spotlight this post!  
Unread 03-11-2005, 18:26
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: Send Byte

Quote:
Originally Posted by CJO
No, I think that what that is doing is converting the hex values into their ASCII equivalents. That is to say, instead of sending 0xA, it sends the ASCII "A".
Yes, that's what Dave's suggestion is doing. If you want the value to be written directly, then that is the same question that the original poster had, and my first post in this thread tells you how to do it (using %c in the printf format string) or you can bypass the printf library altogether and use whatever lower-level write() function is used to send data directly to the serial port driver.

In this case, the data being sent isn't really in 'hex' format - it's just raw data. The program on the other end may choose to display it in hex format, but that doesn't really have anything to do with the sending side. Asking to output the data in 'hex' format will be taken to mean that you wish it to be converted to ASCII for viewing (hence the response Dave gave you).