本文介绍了致命错误:AVR / io.h:没有这样的文件或目录的Arduino的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想测试一个DHT22温度传感器一库,但我得到了一个错误,同时包括来自 DHT.cpp 文件中的内部Arduino的库

I'm trying to test a library for an DHT22 "Temperature Sensor", but I got an error while including an internal arduino library from the DHT.cpp file

我得到这个错误:

C:\Program Files (x86)\Arduino\libraries\DHT\DHT22.cpp:56:20:
fatal error: avr/io.h: No such file or directory  #include <avr/io.h>

DHT22.cpp ,这是错误的块

extern "C" {
 #include <avr/io.h>
 #include <avr/interrupt.h>
 #include <avr/pgmspace.h>
}

我的结论得到了该库没有找到AVR文件夹这是
C:\\ Program Files文件(x86)的\\的Arduino \\五金\\工具\\ AVR \\ AVR \\包括\\ AVR 我检查的另一个内置库servo.cpp,这是包括部分

I got in the conclusion that the library is not finding the avr folder which isin C:\Program Files (x86)\Arduino\hardware\tools\avr\avr\include\avr I checked another built-in library servo.cpp and this is the include part

#include <avr/interrupt.h>
#include <Arduino.h>

但最后一部作品没有错误,我的问题是,为什么DHT库不导入所需的文件和伺服呢?

but the last one works without errors, my question is why the DHT library is not importing the required files and the servo does ?

推荐答案

感谢您的回答。它看起来像我错过了一个参数,我按照这个教程这对于我来说,完美的作品。

Thanks for the answer. It looks like I was missing a parameter, I follow this tutorial which works perfectly for my case.

这篇关于致命错误:AVR / io.h:没有这样的文件或目录的Arduino的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

查看更多