Using Ardurover to have Pixhawk 4 relay control on autonomous missions

Hello, I am new to this ardupilot and the pixhawk 4 FC. I am currently using 4.5.7 version in Ardurover. I am wanting my autonomous soil sampler to go to a dedicated waypoint. Once at the waypoint, I want the pixhawk to output a voltage out of either its aux ports or main i/o ports to the arduino pin. Once the arduino pin sees a change in state on that pin it will trigger the soil sampling process. After the arduino mega finishes the sampling sequence, I want it send a signal back to the pixhawk i/o pin to tell pixhawk to go to the next waypoint and to continue this sequence. I currently have the GPS working in autonomous mode. I am using a skid steer system and am using channels 1 and 2 on the main i/o. I am using pull down resistor on the arduino pin and a voltage divider from the arduino to send 3.3 v back to the pixhawk. I have tried to follow how to write a lua script to control GPIOs to make the pixhawk do the thing that I want, but I have had no luck with finding parameters that it suggests changing. What is the best way to configure this in MissionPlanner. Should I use a Lua Script? Is there another way other that using a Lua Script? What parameters do I change? What are the names of such parameters? In what order do I configure this? Any help would be greatly appreciated.