Tera Term 与 C 中的 Atmel Board

Tera Term with Atmel Board in C

尝试使用 Atmel Mega 328p 板调试问题。

#include <stdio.h>
#include <avr/io.h>

void main() 
{
   while(1)
   {
      printf("hello world,");
   }
   return;
} 

正在 Tera Term 中查看此端口 returns 什么也没有。

Warning : Implicit declaration of printf();

我们的代码中可能存在什么问题?

如果您想在 tera-term 上查看输出,您必须初始化 uC 的 UART 并编写用于重定向输出的自定义函数。除非以这种方式编写,否则 printf 不会在 UART 上输出。 但是在这种情况下,可以在您正在使用的 IDE 的输出控制台中查看程序的输出。