   } else {
     return 0;
   }
+}
+
+void EEPROMWriteInt(int addr, int p_value) {
+  EEPROM.write(addr, ((p_value >> 0) & 0xFF));
+  EEPROM.write(addr + 1, ((p_value >> 8) & 0xFF));
+}
+
+unsigned int EEPROMReadInt(int addr) {
+  byte lowByte = EEPROM.read(addr);
+  byte highByte = EEPROM.read(addr + 1);
+  return ((lowByte << 0) & 0xFF) + ((highByte << 8) & 0xFF00);
 }
 
 void readEEPROM() {

// Reference voltage measured from device
#define Vref 4881
// Vsense1 ratio
#define VDRP 4925

#define DAC_P 9
#define DAC_N 7

long vSenseN = 0;
long aSenseN = 0;

int offsetP = 320;
int offsetN = 200;

unsigned long previousMillis = 0;
const long interval = 10;

DAC_MCP49xx PosDac(DAC_MCP49xx::MCP4921, DAC_P);
DAC_MCP49xx NegDac(DAC_MCP49xx::MCP4921, DAC_N);
