 }
 
 void motorOff() {
-  motor_enable = false;
+  xv_config.motor_enable = false;
   Timer3.pwm(xv_config.motor_pwm_pin, 0);
   Serial.println("Motor off");
 }
 
 void motorOn() {
-  motor_enable = true;
+  xv_config.motor_enable = true;
   Timer3.pwm(xv_config.motor_pwm_pin, xv_config.pwm_min);
   Serial.println("Motor on");
 }
 
 void relayOff() {
-  relay = false;
+  xv_config.relay = false;
   Serial.println("Lidar data disabled");
 }
 
 void relayOn() {
-  relay = true;
+  xv_config.relay = true;
   Serial.println("Lidar data enabled");
 }
 

}

void initEEPROM() {
  xv_config.id = 0x99;
  xv_config.motor_pwm_pin = 9;  // pin connected N-Channel Mosfet

  xv_config.rpm_setpoint = 300;  // desired RPM

  Serial.println(xv_config.Ki);
  Serial.print("PID Kd: ");
  Serial.println(xv_config.Kd);

  Serial.print("Motor Enable: ");
  Serial.println(xv_config.motor_enable);
  Serial.print("Realy: ");
  Serial.println(xv_config.relay);
}

void saveConfig() {
