#include "mcc_generated_files/system/system.h"
#include <string.h>
char msg[] = "Hello World!\r\n";
void UART_write_string(const char *msg)
{
for(uint8_t i = 0; i < strlen(msg); i++)
{
while(!UART.IsTxReady());
UART.Write(msg[i]);
}
UART_write_string(msg);
通过调用 UART_write_string(msg) 编写字符串“Hello World!”或任何消息,传递要在终端上打印的消息。这可以是 printf 的轻量级替代方案,例如,对于 ASCII 字符字符串。
更多使用方法
https://onlinedocs.microchip.com/oxy/GUID-420E6AAC-9141-47BF-A4C7-A6EA17246D0D-en-US-14/GUID-BC229F28-29AC-46A3-9FAA-1681C2E93A5C.html
|