This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Printf question (newbie)

I want to print in a terminal the "%"character when I put

printf(" %c % ",var);

the % doesn't print

why??

Parents
  • "At the printf() sentence,it couldn't jump out,as TI never became 1.
    what's the reason?"


    Purely a guess, since you have not shown your UART initialization code, but your UART is not initialized properly or you have not set the TI bit in initialization (as required by Keil's putchar routine, presuming that's what you are using).

Reply
  • "At the printf() sentence,it couldn't jump out,as TI never became 1.
    what's the reason?"


    Purely a guess, since you have not shown your UART initialization code, but your UART is not initialized properly or you have not set the TI bit in initialization (as required by Keil's putchar routine, presuming that's what you are using).

Children
No data