问题描述
我想测试一个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 ?
推荐答案
感谢您的回答。它看起来像我错过了一个参数,我按照这个教程这对于我来说,完美的作品。
这篇关于致命错误:AVR / io.h:没有这样的文件或目录的Arduino的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!