简体   繁体   English

Tera条款与C中的Atmel董事会

[英]Tera Term with Atmel Board in C

Trying to debug an issue using Atmel Mega 328p Board. 尝试使用Atmel Mega 328p板调试问题。

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

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

Viewing this port in Tera Term returns nothing at all. 在Tera Term中查看此端口完全不返回任何内容。

Warning : Implicit declaration of printf(); 警告:printf()的隐式声明;

What could be the problem in our code? 我们的代码可能是什么问题?

You must initialize UART of the uC and write custom function for redirecting output on it, if you want to view output on tera-term. 如果要在第三时间查看输出,则必须初始化uC的UART并编写用于重定向输出的自定义函数。 printf does not output on UART unless it is written in that way. 除非以这种方式写入,否则printf不会在UART上输出。 However in this case, the output of the program can be viewed in the output console of the IDE which you are using. 但是,在这种情况下,可以在所使用的IDE的输出控制台中查看程序的输出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM