0

I am trying to make an ultrasonic distance meter using Arduino. For this I added the ultrasonic library. But on compiling it shows this error "ultrasonic.h not available". Please tell me how to add this .h file.

marked as duplicate by user31481, MatsK, jfpoilpret, gre_gor, per1234 Feb 23 '18 at 3:40

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • You can literally just create one. Usually they are config files so where you initialise variables etc. – bladepanthera Jun 30 '15 at 12:29
  • Unless this is a module that you have installed from somewhere? In which case it should have one already. If not then try putting an empty one in and see what happens. – bladepanthera Jun 30 '15 at 12:30
  • How did you add your library ? Have you follow these steps shown on the arduino site ? – RYPCORD Jun 30 '15 at 12:55
1

In you Arduino Sketch folder there is a folder called Libraries, create a folder there and put your header file in that folder and restart the Arduino IDE.

For example (PC):

Documents/Arduino/Libraries/ultrasonic/ultrasonic.h

You can now use it in all your projects.

If you only want to use with a particular sketch, place in in the same folder as you sketch and restart Arduino IDE.

Not the answer you're looking for? Browse other questions tagged or ask your own question.