This does look like exactly what I need! Sadly, this produces a new error:
Now when building the linker can’t find ANY of my header files. I had this problem once before with this project and fixed it by adding: “lib_ldf_mode = deep+” to my plattformio.ini, but it seems that this is not helping rn.
My platformio.ini looks like this:
[env:controllino_mega]
platform = atmelavr
board = controllino_mega
framework = arduino
monitor_speed = 115200
build_type = debug
lib_ldf_mode = deep+
extra_scripts = pre:modify_debug.py
;debug_build_flags = -Os -ggdb3 -g3
;debug_build_flags = -Og -g
;debug_build_flags = -O0 -g3
;build_flags= -fstack-usage -Wstack-usage=8000
lib_deps =
controllino-plc/CONTROLLINO @ ^3.0.7
br3ttb/PID @ ^1.2.1
And my folder structure is like this:
|–rootdir
|…|–lib
|…|…|–sensors
|…|…- sensor.hpp
|…|…- sensor.cpp
|…|–include
|…|–src
|…|…- main.cpp
The resulting error message when trying to build is:
Verbose mode can be enabled via -v, --verbose
option
CONFIGURATION: xhttps://docs.platformio.org/page/boards/atmelavr/controllino_mega.html
PLATFORM: Atmel AVR (4.1.0) > Controllino Mega
HARDWARE: ATMEGA2560 16MHz, 8KB RAM, 248KB Flash
DEBUG: Current (avr-stub) External (avr-stub, simavr)
PACKAGES:
- framework-arduino-avr @ 5.1.0
- toolchain-atmelavr @ 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder → xhttps://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ deep+, Compatibility ~ soft
Found 16 compatible libraries
Scanning dependencies…
Dependency Graph
|-- CONTROLLINO @ 3.0.7
|-- PID @ 1.2.1
|-- interface
|-- errorHandling
|-- config
|-- SPI @ 1.0
|-- util
|-- statemachine
|-- dilumix
|-- actors
|-- sensors
|-- UART
Building in debug mode
Compiling .pio\build\controllino_mega\src\main.cpp.o
Compiling .pio\build\controllino_mega\lib638\SPI\SPI.cpp.o
Compiling .pio\build\controllino_mega\lib162\CONTROLLINO\Controllino.cpp.o
Compiling .pio\build\controllino_mega\lib4d5\PID\PID_v1.cpp.o
Compiling .pio\build\controllino_mega\lib7b5\util\PID.cpp.o
Compiling .pio\build\controllino_mega\lib7b5\util\analogRead.cpp.o
Compiling .pio\build\controllino_mega\lib7b5\util\filters.cpp.o
Compiling .pio\build\controllino_mega\lib7b5\util\stableCycleTime.cpp.o
src\main.cpp:1:10: fatal error: CInterface.hpp: No such file or directory
Compiling .pio\build\controllino_mega\lib7b5\util\timer.cpp.o
- Looking for CInterface.hpp dependency? Check our library registry!
- CLI > platformio lib search “header:CInterface.hpp”
- Web > xhttps://registry.platformio.org/search?q=header:CInterface.hpp
#include “CInterface.hpp”
^~~~~~~~~~~~~~~~
compilation terminated.
Compiling .pio\build\controllino_mega\lib104\actors\actuonixP16.cpp.o
In file included from .pio\libdeps\controllino_mega\CONTROLLINO\Controllino.cpp:17:0:
.pio\libdeps\controllino_mega\CONTROLLINO\Controllino.h:23:10: fatal error: SPI.h: No such file or directory
- Looking for SPI.h dependency? Check our library registry!
- CLI > platformio lib search “header:SPI.h”
- Web > xhttps://registry.platformio.org/search?q=header:SPI.h
#include “SPI.h”
^~~~~~~
compilation terminated.
Compiling .pio\build\controllino_mega\lib104\actors\dcMotor.cpp.o
Compiling .pio\build\controllino_mega\lib104\actors\valve.cpp.o
.pio\libdeps\controllino_mega\PID\PID_v1.cpp:14:10: fatal error: PID_v1.h: No such file or directory
[…]
I am not sure whether it has something to do with how my file structure is or if I messed up something else…
PS I had to break all links by putting an “x” before them since new users can’t post more than two links, apparently.