This project contains a stand-alone library for the Raspberry Pi Pico SDK, written in C. The library is made for the MPU6050 sensor from InvenSense. You have to download and setup the library to have it work properly.
- /src - Source files of the library
- /include/haw - Header files of the library
- /example - Example program of how this library might be implemented
- CMakeLists.txt - CMake file for automated linking
For this library CMake is used for linking. If you don't know how to implement this library to your project, use these steps as a helping guide:
-
Create a new folder in your Pico project called (for example) vendors
-
Update your top level CMakeLists.txt file by adding the following line
# Adds a CMakeLists.txt file from a subdirectory add_subdirectory(vendors)
Write it below the pico_sdk_init() line.
-
Download this repository and paste it into the vendors folder
-
Create a new CMakeLists.txt file inside the vendors folder
-
Edit the CMakeLists.txt. Add the following lines:
cmake_minimum_required(VERSION 3.12) # Adds a CMakeLists.txt file from a subdirectory add_subdirectory(rpi-pico-mpu6050-master)
-
Include this project into your project by adding a new target link library. Open your top level CMakeLists.txt file and add:
target_link_libraries(${PROJECT_NAME} /* ... other libs */ haw_mpu6050 )
After these steps you can go ahead and recompile CMake. Everything should be linking automatically.
You can use this library simply by including the header located at "haw/MPU6050.h".
For examples take a look at the ./example folder
Every help is appreciated, feel free to fork my project and make pull requests.
v1.0 - Initial release
MIT License