Installing Platform IO

Source

Creating New Project

Pasted image 20250607215312.png|left

Test Project
├── include
│   └── README
├── lib
│   └── README
├── platformio.ini
├── src
│   └── main.cpp
└── test
    └── README

#include "header.h"

int main (void)
{
 ...
}
lib/
	- mylib/
		- mylib.c
		- mylib.h 
#include <mylib.h>

Pasted image 20250607214248.png
Pasted image 20250607214310.png

Pasted image 20250607214510.png

Publishing new Lib to Platfom io

{
  "name": "Robo",
  "version": "0.0.1",
  "description": "A library for Arduino/PlatformIO",
  "keywords": "sensor, i2c, arduino",
  "repository": {
    "type": "git",
    "url": "https://github.com/AI-Robot-GCEK/robo"
  },
  "authors": [
    {
      "name": "Arun CS",
      "email": "aruncs31ss@gmail.com"
    }
  ],
  "license": "MIT",
  "dependencies": {
    "adafruit/Adafruit PWM Servo Driver Library": "3.0.2"
  },
  "frameworks": ["arduino"],
  "platforms": ["atmelavr", "espressif32"]
}

folder_name/
	- src/
		- .cpp
		- .h
	- examples/ 
library.json

Account Creation

pio account register -u username -p asdasdsa1@ --firstname Arun --lastname CS

Platform io lib structure

robo-movements
├── library.json
├── LICENSE
└── src
    ├── robo-movements.cpp
    └── robo-movements.h
project
├── include
│   ├── configs.h
│   └── pins.h
├── lib
│   └── robo-database
│       └── src
│           ├── robo-database.cpp
│           └── robo-database.h
├── LICENSE
├── platformio.ini
├── README.md
├── src
│   └── main.cpp
└── test
    └── README

Publishing New Lib

pio account login
pio pkg publish .

Updating your lib

git add .
git commit -m "Release version 1.0.1"
git tag -a 1.0.1 -m "Version 1.0.1"
git push origin --tags
pio pkg publish .

Pasted image 20250607220807.png