Click here to Skip to main content
15,905,325 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi,

i am just beginning a new project which requires PC to Microcontroller board via rs232.

everyting is fine but i dont know how to send Non-graphic ASCII characters.

i mean SOH ACK NAK ETX.... etc. i found some of the such as LF NULL

do i have to use ascii to number functions each side of my connections?

thanks
Posted

1 solution

Have a look at this: http://www.asciitable.com/[^]

It is literally a case of casting the number as a character (or better an unsigned byte) and inserting it in the output stream.
C++
#define AS_SOH ((unsigned byte) 0x01)
Bytes are generally better for this as there is no chance of a Unicode to ASCII conversion going on that you don't know about.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900