I don’t know if there is a way to install a library from Git but the library that is provided do not have the 3axis accelerometer library that I need. Can someone point me into the right direction, please?
If there is a library you need in a git repo, and it’s not in the PlatformIO library registry, you can pull it into your project via your
lib_deps option by simply referencing the URL for the library…
… I simply hit the copy to clipboard icon …
… and put it in the my projects
… and PlatformIO automatically installed it. You can also give it the URL of the repo (without the .git on the end) or the URL to the zip file - PlatformIO will work it out.
@pfeerick, is there a way to refer to a certain tag or release in the URL - means: not the latest one?
Just to repeat the question…
When this method with github link is used, how can we choose library version, or the latesest is always default?
As the documentation says, you can control which branch, tag or commit hash to pull. If not specified, it will take the latest version of the default branch.
Thanks. So, for example, it`s:
While this is technically correct, if you want to reference stable version of a built-in platform like espressif32, you would just do s documented
platform = firstname.lastname@example.org
Same goes for stable library versions in
lib_deps where you use semver.
You should only fall back to git links if you really need a specific commit hash or latest branch version.