Terminate command using uArm Controller

I am running an Arduino sketch on the uArm controller. I am using joysticks as input devices. The pins connected to the joystick have internal pullups selected and when a switch on the joystick closes the pin is pulled low.

When I close a switch on a joystick the pin is pulled low and I send a command to move the arm. When the joystick returns to the center position and the switch opens the pin is pulled high by the internal pullup.

How can I terminate the command when the joystick returns to the center position and the pin is pulled high?