   // read byte from LIDAR and relay to USB
   if (Serial1.available() > 0) {
     inByte = Serial1.read();  // get incoming byte:
-    if (relay) {
+    if (xv_config.relay) {
       Serial.print(inByte, BYTE);  // relay
     }
     decodeData(inByte);
   }
 
-  if (motor_enable) {  
+  if (xv_config.motor_enable) {  
     rpmPID.Compute();
     if (pwm_val != pwm_last) {
       Timer3.pwm(xv_config.motor_pwm_pin, pwm_val);

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

void saveConfig() {

}

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

  xv_config.rpm_setpoint = 300;  // desired RPM
