Skip to main content

emergency_stop()

Description#

This function immediately stops all commands and stops all motors, so the drone will stop flying immediately.
The function will also zero-out all of the flight motion variables to 0.

Syntax#

Python: emergency_stop() Arduino: emergencyStop()

Parameters#

None

Returns#

None

Example Code#
Python#
#Python code
import CoDrone
drone = CoDrone.CoDrone()
drone.pair()
drone.takeoff()
drone.emergency_stop()
drone.close()
Arduino#
//Arduino code
#include<CoDrone.h> //header
void setup(){
//open serial and connect
CoDrone.begin(115200);
CoDrone.pair(Nearest);
CoDrone.takeoff(); // take off and hover for 3 second
CoDrone.emergencyStop(); // emergency stop
}
void loop(){
}