Skip to content

_EEPROM_offset

Arnd edited this page Dec 12, 2020 · 2 revisions

_EEPROM_offset

This is an unsigned 16-bit integer value which defaults to 0 but can be set by the user to allow the INA library device information to be stored beginning at the "_EEPROM_offset" address rather than at the beginning of the EEPROM. If it is changed, it must be done before calling the begin() function. If it is changed afterwards, the program will cease to read correct values from EEPROM for all INA devices.

No range error checking is performed.

Example:

INA_Class INA(); // Instantiate the class
void setup() {
  INA._EEPROM_offset = 32; // first 32 bytes of EEPROM reserved, start after that
  INA.begin(1,100000);  // 1A max current and a 0.1 Ohm shunt resistor 
                        // Note that a power resistor should be used 
                        // to dissipate sufficient generated heat, 
                        // Watts = Amps² x Resistance (0.1W in this case)
} // of Setup

void loop() {
   /* ... */
} // of main loop