Turn on the motor in clockwise and counterclockwise direction in external DC motor

I put a DC motor in my drone and I want to turn it on when some condition are satisficed, how can I do that and what is the code for that ?
I found that there is only servo motor in the mission planer. So how about the DC motor. I want to send a signal clockwise then after some condition I want to make it turn counterclockwise.

You can achieve this with some Lua scripting and DC motor driver that has a direction and a PWM pin. Direction can be controlled by setting the servo output as relay and PWM is just PWM like when you are controlling a servo.