Setting digital output on APM2.6 based on a channel

Hi,
I’d like to know how I could set one digital output pin on the APM2.6 when a channel changes. What is the best way to do this?
Thanks