Problem with SR04 library on Ubuntu 18.04

I tried to install the HC-SR04 on my ubuntu machine and i keep getting the No Such file or directory message so for solve the problem

  • decompress the file HC-SR04.zip
  • rename the folder to HCSR04 (remove the - or it won't work)
  • copy the folder to /usr/share/arduino/libraries
  • change folder permissions to 755
  • open the Arduino IDE and it should be fine

Hope this helps

isan1989:
rename the folder to HCSR04 (remove the - or it won't work)

This indicates you're using a very old version of the Arduino IDE. That restriction was removed long ago. I suspect you installed the Arduino IDE using apt install arduino, which gives you an ancient Arduino IDE version. You should always download the official Arduino IDE from the download page on this website: