I’ve written up a small eBook thingy on the subject of writing libraries for use with the Arduino IDE and PlatformIO. It’s available here: https://github.com/NormanDunbar/WritingLibraries/releases/latest.
That URL will always take you to the very latest release, in case I have to make changes.
The eBook covers the following:
- How to write a small “pure” Arduino library. This is named
digitalPinand uses the Arduino language throughout. It can be used in the Arduino IDE and also, in PlatformIO projects using the AVR platform and the Arduino Framework.
- How to convert the above library, from Arduino Language, to pure AVR C++, but still have it usable in the Arduino IDE and in PlatformIO projects using the Arduino framework. This is
- Converting the above library into a format suitable as a “pure” PlatformIO library, packaging and publishing it for use in projects written without the Arduino framework. This is also
avrDigitalPinbut the repository is named
pioDigitalPinas the names cannot clash on GitHub!
Hope someone finds it useful.
The three developed libraries are available on GitHub – there are links in the document, and the last one, is also published to https://platformio.org/lib/show/12760/avrDigitalPin.