Using potentiometer joystick to simulate pushbutton switch

Thanks for the input- this gives me a clearer starting point! I'll need to read up on bool variables.