'NewPing' library for ultrasonic sensor

Thread Starter

tanmay2001

Joined Mar 20, 2015
2
hi, I compiled the same sketch using the same New Ping library downloaded from the arduino website. But intea of compiling it showed an error message which is -

Arduino: 1.6.1 (Windows 8.1), Board: "Arduino Due (Programming Port)"
In file included from NewPing15Sensors.pde:1:0:
C:\Users\dell\Documents\Arduino\libraries\NewPing/NewPing.h:113:20: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^
compilation terminated.
Error compiling.
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
 

djsfantasi

Joined Apr 11, 2010
9,163
In the Arduino folder under "Program files", search for io.h

I found it in .../Arduino/hardware/tools/avr/avr/include/avr
Phew! If you can't find it, perhaps you should re-install the Arduino IDE.
 

HopWorks

Joined Jul 29, 2015
3
Please do not hijack someone's thread. Here you have your own.

This thread spun off from:

http://forum.allaboutcircuits.com/threads/newping-does-not-name-a-type.103896/
I went to the thread you linked and did not see anything about the error issue posted here. I found this thread by looking for answers as to why I also have an issue with avr/io.h not found. It was that the library did not support the board I am using.

I just wanted to add that. Maybe I read the OP issue incorrectly, but the first post google-searches as a result to the common issue of avr/io.h not being found while compiling. And this issue with me also made me wonder why the Arduino IDE could not find it even though io.h is located just where it should be on my system.

Thank you for the awesome forum!
 
Top