Click here to Skip to main content
15,884,237 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

i try to write data from serial port to my terminal screen.
The Data will be formated and print out with the printf command

printf(" Data %x ",&c);

The programm will be correct... it shows me the hex.
But the printed hex are not correct... The hex have the wrong value.

When i try to write the raw Data to a file and read this with:

cat /dev/ttyUSB0 | xxd

the Output will be correct.

Can anyone help me?

By
Posted

Quote:
printf(" Data %x ",&c);
Probably the above line should be instead
C
printf(" Data %x ", c);

However it is difficult to help without seeing more code.
 
Share this answer
 
THX...
That Sign "&" was my mistake...
 
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