Help with programming - turn off JoystickDigitalToMotor

I have some code where I have mapped the JoystickDigitalToMotor (channel 5 up and down to motor 1). This is used to move an arm up and down.

Programmatically, I want to disable this mapping and use channel 5 for nothing (prevent the operator from pressing the buttons and getting a response) - for example, push channel 8 button 1 and then channel 5 is disabled. I see how I could reassign channel 5 to other motors (that do not exist for example motor 9) and that could be a workaround but I want to undo the mapping of the joystick to the motor. Can that be done?

Should I attach some code for more help or can you understand what I am trying to do?

Sorry on the delay I didn’t see your post…

Anyways, just put JoystickDigitaltoMotor in an if statement and only call it when you want. You may also want to set the motor #1 to stop in the else condidtion.