The current code is very Arduino-standard, with each .cpp having setup and loop . THis works well for now but ....
It would be worth considering reworking as a class hierarchy
Base
Sensor
I2C_sensor
Analog_sensor
Digital_sensor
Actuator
Control
Some of the code could then reuse code fragments - so for example the loop could automatically do the nextLoopTime recording if the class had a "MS" member.
One consideration would be saving code memory space, but another would be whether sensors etc then became easier or harder to add to the project.
The current code is very Arduino-standard, with each .cpp having setup and loop . THis works well for now but ....
It would be worth considering reworking as a class hierarchy Base
Some of the code could then reuse code fragments - so for example the loop could automatically do the nextLoopTime recording if the class had a "MS" member.
One consideration would be saving code memory space, but another would be whether sensors etc then became easier or harder to add to the project.