Who can help me

Arduino: 1.8.13 (Windows 10), Bo mạch:"Arduino Uno"

sketch_oct17a:1:10: fatal error: BH1750.h: No such file or directory

#include <BH1750.h>

      ^~~~~~~~~~

compilation terminated.

exit status 1

BH1750.h: No such file or directory

Thư viện không hợp lệ được tìm thấy trong C:\Users\truog\OneDrive\Tài liệu\Arduino\libraries\BH1750-1.1.4: no headers files (.h) found in C:\Users\truog\OneDrive\Tài liệu\Arduino\libraries\BH1750-1.1.4

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

You need to install the BH1750 library.

In the Arduino IDE, go to menu > Sketch > Include Library > Manage Libraries.

Search for BH1750, select and Install.

I installed the BH1750 but the same mistake

There seems to be a version 1.2.0, can you update the libraries ?
Are your files located on a OneDrive ? Perhaps that causes trouble.


yes my files located on a OneDrive, i updated the library.

does the file
C:\Users\truog\OneDrive\Tài liệu\Arduino\libraries\BH1750-1.1.4\src\BH1750.h
exist? can you open it in an editor?


yes i can open although i installed the library of the BH1750, the project doesn't run

@tung120298
Your duplicate topic on the same subject has been deleted and this one moved to a more suitable location.

Please take some time to read the forum instructions How to get the best out of this forum

Thanks,

Can you try to open or view the file via C:\ On the lower left of your picture there is something that shows
Dia Cuc Bo (C:)
Start by clicking that then Users, truog etc. The one you are viewing is different.

Hi @tung120298. Unfortunately, the Arduino IDE seems to have a bug that makes it not be able to deal correctly with some of the "extended" (probably not the correct term) characters in the "Tài liệu" folder name of your Arduino sketchbook path. I was able to reproduce it by putting my sketchbook under a path that contained a folder of that name. My path was not under OneDrive, so your use of OneDrive is not related to this problem.

I know there has already been one or more bug reports about this. Including this one:

Until such time as it might be fixed, the best you can do is to work around the bug by changing your sketchbook folder to some path that does not contain any problematic characters. Other than that restriction, you can put the sketchbook folder anywhere that is convenient to you.

The sketchbook folder path is configured in the Arduino IDE by doing this:

  1. Select File > Preferences from the Arduino IDE menus.
  2. Enter the new sketchbook path in the "Sketchbook location" field.
  3. Click the OK button.

If you have anything of value in the old sketchbook folder:

C:\Users\truog\OneDrive\Tài liệu\Arduino

you can copy it over. Note that your libraries are installed there, so you will need to either copy them over or else just reinstall them via the Arduino IDE Library Manager.

1 Like

@tung120298 This problem presents itself over and over, in different forms. Moral of the story: never use anything but (a-z, A-Z, 0-9, _) and no spaces in your filenames and paths, on anything in your computer. Problem solved.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.