simple latching function

Very Simple question: He asks with some concern not knowing the lingo…

I have an RC signal which provides a measurable output between 1100-1900. Neutral is 1500. For example I have set up switches based on

if (unBallastIn > 1800)
{
digitalWrite(PISTON_DIVE_PIN, LOW);
}
else if (unBallastIn < 1800)
{
digitalWrite(PISTON_DIVE_PIN, HIGH);
}

What I want is to trigger PISTON_DIVE_PIN to LOW when unBallastIn is >1800, but remains on LOW after unBallastIn goes back to under 1800. Ie a latching effect. Is there a simple way to do that?

Try something like:

int latched = LOW;
int PISTON_DIVE_PIN = 12;
int unBallastIn = 0;
void setup(){
  //All your setup stuff here
}


void loop(){

  if (unBallastIn > 1800)
  {
      latched = HIGH;
  }
  

 if (latched)
  {
      digitalWrite(PISTON_DIVE_PIN, LOW);     
  }
  else 
  {
    digitalWrite(PISTON_DIVE_PIN, HIGH);
  }


}

What I want is to trigger PISTON_DIVE_PIN to LOW when unBallastIn is >1800, but remains on LOW after unBallastIn goes back to under 1800. Ie a latching effect. Is there a simple way to do that?

That's half of a requirement. Complete requirements are almost always easy to implement. Incomplete requirements are almost always nearly impossible to implement.

Make the requirement complete by describing when the pin SHOULD change back to HIGH.

The simple way to implement the requirement AS STATED is to remove the else statement, but that hardly seems like the right thing to do.