Thread: Send Byte
View Single Post
  #6   Spotlight this post!  
Unread 18-01-2005, 19:12
the_undefined's Avatar
the_undefined the_undefined is offline
German FES
AKA: Felix Geisendörfer
#1648 (Gearbox Gangstas)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Germany
Posts: 77
the_undefined has a spectacular aura aboutthe_undefined has a spectacular aura about
Re: Send Byte

Quote:
Originally Posted by Dave Flowerday
Felix,
If you use %c in your printf format string (instead of %d) it will send it as a single byte. It will just send the 0-255 value of the argument you give it rather than converting it into an ASCII number first. As you probably know, you'll need something more fancy than the IFI loader terminal program or Hyperterminal to view those bytes that come out if you do that, though.
The %c thing didn't work but then I found that in the printf class:
* 2. All bytes (8 bits) or bit references (rc_dig_in01) must be type-cast to a
* 16 bit word. The %c directive is unsupported.

Just in case somebody else needs to deal with that at some point ...

Bye

Felix