I have uploaded the code for INA226 processing. It compiles without errors, but I could not test it.
I have also uploaded the code for the input of an analog measurement over A0, which can be used to measure the half battery voltage, the double battery voltage (in case of 48V batteries where the ESP is on the lower half) or a panel measurement.
It is configured that way:
Code:
//----------------------- HARDWARE OPTIONS ---------------------------------
#define AO_IS_DOUBLEBATTERY // _NONE , _DOUBLEBATTERY , _HALFBATTERY, _PANEL
#define A0_MAX 50 // if A0 is used, define the voltage of the full range measure
#define D7_IS_NONE // _NONE , _VICTRON
#define OLED_IS_NONE // _NONE , _48X48 , _128X48
#define OLED_IS_NORMAL // _IS_NORMAL, _IS_REVERSED To turn the display 180° if required
#define INA_IS_226 // _NONE , _226
//#include "MPPT_75_15.h"
#include "SHUNT_10A_75mV.h"
//#include "LiFePo_13V_100Ah.h"
//----------------------- SOFTWARE OPTIONS ---------------------------------
#define WEATHER_IS_OWM // _NONE , _OWM // (Source of the Weather Information)
#define DASHBRD_IS_THINGER // _NONE , _THINGER
...
Regarding the shunt, you need to define a custom Shunt_*.h file according to the caracteristics of the shunt you will use, which is to be placed in the library folder.
Just take SHUNT_10A_75mV.h as a template.
All should work, but is untested. Tell me where you have problems.
Please tell me if something is not working or unclear.