Collect2: error: ld returned 1 exit status *** [.pio/build/esp12e/firmware.elf] Error 1

Looks like you put the definition of a variable in header files and not only the declaration. This leads to a duplicate definition for every .cpp file which includes a certain header name. See e.g. Splitting cpp files - #2 by maxgerhardt.