I am trying to write a very simple program to output a serial string including hex codes when I press a button. It works fine if the string does not include 0x00, but if it does this is treated as 'end of string' and does not output.
printf ("\x01\x02\x00\x03\x04")
SBUF =0x01 SBUF =0x02 SBUF =0x00 SBUF =0x03 SBUF =0x04
But what is stdout? How does one send a byte to it?? - see above! Stdout is where printf() sends its output. Keil have implemented printf() and allowed us to change the device treated as being stdout by modifying the putchar() function.