Reading ADC input and Controlling digital I/O pins

Hello Everyone!

I am working on a project that requires reading analog input from the ADCs and interacting with the digital I/O pins of a PIXHAWK (PX4) microcontroller (onboard a 3DR Iris+ quadcopter if that is relevant). I’ve spent hours delving into the code trying to figure out how to do this and am having a lot of troupble. Does anybody know how I can do this?