1

Topic: RemoteXY Communication Failure Watch dog

I am a new user of this brilliant App. One thing that I found wanting was a comms failure watchdog. So I wrote this script.
It works!!.

Insert this at the top of your void loop.

void loop()
{   
  RemoteXY_Handler ();

  if (RemoteXY.connect_flag==0){
 
  digitalWrite(PIN_SWITCH_1, LOW);
 
}
  else

  digitalWrite(PIN_SWITCH_1, (RemoteXY.switch_1==0)?LOW:HIGH);
}

2

Re: RemoteXY Communication Failure Watch dog

On my tracked rover, I have this in my

void loop()

 
In my case, it centers the joystick values (which programmatically stops the tracks as the following code takes those values and controls the motors) and flashes the headlight to signal loss of connection to the App.

  // Connection Failsafe
  if (RemoteXY_isConnected() == 0) {
    RemoteXY.joystick_1_x = 0; // Set for dead stop
    RemoteXY.joystick_1_y = 0; // Set for dead stop
    // Flash headlamp LED when App not connected.
    digitalWrite(PIN_LED, !digitalRead(PIN_LED));
    delay(500);
  }
"And voila, which is French for.......'and then I found out.'" - Ready Player One

3

Re: RemoteXY Communication Failure Watch dog

Thank you mate, I will try your suggestion as well.