   motor_enable = true;
   Timer3.pwm(xv_config.motor_pwm_pin, xv_config.pwm_min);
   Serial.println("Motor on");
+}
+
+void retransmitOff() {
+  retransmit = false;
+  Serial.println("Lidar data disabled");
+}
+
+void retransmitOn() {
+  retransmit = true;
+  Serial.println("Lidar data enabled");
 }
 
 void setRPM() {

  Serial1.begin(115200);  // XV LDS data 

  Timer3.initialize(30); // set PWM frequency to 32.768kHz  
  Timer3.pwm(xv_config.motor_pwm_pin, pwm_val); // replacement for analogWrite()

  myPID.SetOutputLimits(xv_config.pwm_min,xv_config.pwm_max);
  myPID.SetSampleTime(20);
  myPID.SetMode(AUTOMATIC);

  initSerialCommands();
}

}

void help() {
  Serial.println("List of available commands (case sensitive");
  Serial.println("  GetConfig");
  Serial.println("  SaveConfig");
  Serial.println("  ResetConfig");
  Serial.println("  SetRPM");
  Serial.println("  SetKp");
  Serial.println("  SetKi");
  Serial.println("  SetKp");
  Serial.println("  ShowRPM");
  Serial.println("  HideRPM");
  Serial.println("  MotorOff");
  Serial.println("  MotorOn");
  Serial.println("  RetransmitOff");
  Serial.println("  RetransmitOn");
}

void getConfig() {
  Serial.print("PWM pin: ");
  Serial.println(xv_config.motor_pwm_pin);

  Serial.print("Target RPM: ");
  Serial.println(xv_config.rpm_setpoint);

  Serial.print("Max PWM: ");
  Serial.println(xv_config.pwm_max);
  Serial.print("Min PWM: ");
  Serial.println(xv_config.pwm_min);

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

void saveConfig() {
  EEPROM_writeAnything(0, xv_config);
}


