Hi, I'm trying to connect to an arduino uno connected to an mpu6050.
I followed the following guide https://www.hackster.io/Shilleh/how-to-connect-mpu6050-to-arduino-uno-301814 in order and it shows me the following error when I try to compile Compilation error: Adafruit_MPU6050.h: No such file or directory.
Hi @roni230698. Did you perform this step from the instructions?:
- Install the Adafruit MPU6050 library with all corresponding dependencies
Did you install the Adafruit MPU6050 library?
IDE -> Tools -> Manage Libraries
Search for "Adafruit mpu6050"
Install.
OK, I'm going to ask you to provide the full verbose output from a compilation.
This procedure is not intended to solve the problem. The purpose is to gather more information.
Please do this:
- Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
The "Preferences" dialog will open. - Check the box next to "Show verbose output during: ☐ compile" in the "Preferences" dialog.
- Click the "OK" button.
The "Preferences" dialog will close. - Select Sketch > Verify/Compile from the Arduino IDE menus.
- Wait for the compilation to fail.
- You will see a "Compilation error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
- Open a forum reply here by clicking the "Reply" button.
- Click the
<CODE/>icon on the post composer toolbar.
This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.

- Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
This will paste the compilation output into the code block. - Move the cursor outside of the code block markup before you add any additional text to your reply.
- Click the "Reply" button to post the output.
In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here.
Click here for attachment instructions
- Open any text editor program.
- Paste the copied output into the text editor.
- Save the file in
.txtformat. - Open a forum reply here by clicking the "Reply" button.
- Click the "Upload" icon (
) on the post composer toolbar:

The "Open" dialog will open. - Select the
.txtfile you saved from the "Open" dialog. - Click the "Open" button.
The dialog will close. - Click the "Reply" button to publish the post.
Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.
FQBN: arduino:avr:uno
Using board 'uno' from platform in folder: C:\Users\roni2\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Using core 'arduino' from platform in folder: C:\Users\roni2\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Detecting libraries used...
C:\Users\roni2\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\roni2\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\roni2\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard C:\Users\roni2\AppData\Local\Temp\arduino\sketches\D076D6914C52FC6C3D981DB099BE5E4E\sketch\basic_readings.ino.cpp -o nul
Alternatives for Adafruit_MPU6050.h: [Adafruit MPU6050@2.2.6]
ResolveLibrary(Adafruit_MPU6050.h)
-> candidates: [Adafruit MPU6050@2.2.6]
C:\Users\roni2\AppData\Local\Temp\.arduinoIDE-unsaved202467-11824-15e6a4b.wlqwi\basic_readings\basic_readings.ino:3:10: fatal error: Adafruit_MPU6050.h: No such file or directory
#include <Adafruit_MPU6050.h>
^~~~~~~~~~~~~~~~~~~~
compilation terminated.
C:\Users\roni2\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\roni2\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\roni2\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard -IC:\Users\roni2\OneDrive\מסמכים\Arduino\libraries\Adafruit_MPU6050 C:\Users\roni2\AppData\Local\Temp\arduino\sketches\D076D6914C52FC6C3D981DB099BE5E4E\sketch\basic_readings.ino.cpp -o nul
Alternatives for Adafruit_MPU6050.h: [Adafruit MPU6050@2.2.6]
ResolveLibrary(Adafruit_MPU6050.h)
-> candidates: [Adafruit MPU6050@2.2.6]
exit status 1
Compilation error: Adafruit_MPU6050.h: No such file or directory
And there's your problem. Non ASCII characters in your library path.
And a workaround from @ptillisch:
Indeed, after changing the folder path, the problem was solved.
Thank you!
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
