Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

ImageCraft Products FAQ-O-Matic : All Compilers — V6 — may also apply to V7 : How comes when I use printf(), \n does not move the cursor to the right place in the terminal window?

0
Posted

ImageCraft Products FAQ-O-Matic : All Compilers — V6 — may also apply to V7 : How comes when I use printf(), \n does not move the cursor to the right place in the terminal window?

0

Since standard file IO is not meaningful for an embedded microcontroller, much of the standard stdio.h content is not applicable. Nevertheless, some IO functions are supported. Use “#include ” before using these functions. You will need to initialize the output port. The lowest level of IO routines consists of the single character input (getchar) and output (putchar) routines. Thus, if you want to use a higher level function on a different device, for example printf to an LCD, all you need to do is to redefine the low level function. See Overriding a Library Function. Note: By default, the single character output function putchar sends the character out to the UART device without modification. However, for the output to appear as expected on a Windows terminal program, the ‘\n’ character must be mapped to the character pair carriage return and linefeed (CR/LF). This can be done by using the following statement: extern int _textmode; // this is defined in the library … _textm

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123