Private Libraries / Modules

I have some code like wifi part oder display part etc. outsourced from main.ccp may call it libraray or modules. So i can easy use them in other projects as they are or with slight mods. For the moment I copy the content off the .cpp and .h files per hand from a project where I used them. What I like to have a central place from where I can include them if no changes are needed or copy them I they have to be modified.

What do I have to do?

Thanks
Rainer

Create a folder where you put all your common library folders and use lib_extra_dirs.

Still problems with the syntax/path
I am on OS X
in my homedir is .platformio with some subdirs
I created a new one called extras und below one called common und this I have to files wifi.cpp and wifi.h
so the complete path is my-imac:.platformio/extra/common/wifi.cpp and .h respective
my platform.ini is

platform = espressif8266
board = esp12e
framework = arduino
monitor_speed = 115200
lib_deps = beegee-tokyo/DHT sensor library for ESPx@^1.18

;[env:myenv]
lib_extra_dirs =
  /extra/common

[platformio]
description = DHT22 to HomeAssist

ยดยดยด
in main.cpp is
#include <wifi.>

but include fails
I also tried with
lib_extra_dirs =
  /extra/common/


What I'm doing wrong

Rainer