A brief description of what your library does and what problem it solves.
- Feature 1
- Feature 2
- Feature 3
- Open the Arduino IDE
- Go to Sketch > Include Library > Manage Libraries...
- Search for "YourLibraryName"
- Click "Install"
- Download the latest release as a ZIP file
- In the Arduino IDE, go to Sketch > Include Library > Add .ZIP Library...
- Select the downloaded ZIP file
The library is organized as follows:
YourLibraryName/
├── examples/
│ ├── Example1/
│ │ └── Example1.ino
│ └── Example2/
│ └── Example2.ino
├── src/
│ ├── YourLibrary.h
│ └── YourLibrary.cpp
├── keywords.txt
├── library.properties
└── README.md
- examples/: Contains example sketches demonstrating library usage
- src/: Contains the source code files
- keywords.txt: Defines keywords for syntax highlighting in the Arduino IDE
- library.properties: Metadata for the Arduino Library Manager
- README.md: This documentation file
The library.properties
file is essential for Arduino Library Manager. Below is a sample with explanations for each field:
name=YourLibraryName
version=1.0.0
author=Your Name <your.email@example.com>
maintainer=Your Name <your.email@example.com>
sentence=A short, one-sentence description of your library.
paragraph=A longer description of your library, explaining its functionality in more detail.
category=Other
url=https://github.com/yourusername/your-library
architectures=*
depends=DependencyLibrary1 (>=1.0.0), DependencyLibrary2
includes=YourLibrary.h
- name: The library name (letters, numbers, underscores only, no spaces)
- version: Library version following semantic versioning (MAJOR.MINOR.PATCH)
- author: Your name and email
- maintainer: Who maintains the library (usually same as author)
- sentence: A brief description (max 100 characters)
- paragraph: A longer description (max 500 characters)
- category: One of: Display, Communication, Signal Input/Output, Sensors, Device Control, Timing, Data Processing, Data Storage, Other
- url: URL to your library's repository or website
- architectures: Supported architectures (use * for all architectures)
- depends: Comma-separated list of dependencies with version requirements
- includes: Main header file(s) to be included by the user
- name: Use only letters, numbers, and underscores. This will be the name users search for in the Library Manager.
- version: Follow semantic versioning - increment MAJOR for incompatible API changes, MINOR for backward-compatible additions, and PATCH for bug fixes.
- sentence: Keep it concise and descriptive. This appears in the Library Manager search results.
- paragraph: Provide more details but stay under 500 characters.
- category: Choose the most appropriate category for your library.
- architectures: Use * for universal compatibility or specify architectures like "avr,sam,esp8266,esp32".
#include <YourLibrary.h>
YourLibrary myInstance;
void setup() {
Serial.begin(9600);
myInstance.begin();
}
void loop() {
myInstance.doSomething();
delay(1000);
}
Initializes the library.
Performs the main functionality.
The library comes with several examples that demonstrate its usage:
- BasicExample: Shows the basic functionality
- AdvancedExample: Demonstrates more complex features
- Arduino Uno
- Arduino Mega
- Arduino Nano
- ESP8266
- ESP32
- DependencyLibrary1 (>= 1.0.0)
- DependencyLibrary2
This library is licensed under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.