Function Documentation
version 1.1.3 (Changelog)
Connection
pair()
Description
This function connects your controller with the program. You can set debug equal to True if you want to see helpful print statements that can help you debug your code. We recommend setting this to True to check if commands are being skipped. You can also set the specific USB port name.
Syntax
pair()
pair(port_name)
pair(debug=False)
pair(debug=False, port_name)
Parameters
string port_name: the port name or number.
boolean debug: Defaults to False. True to see helpful print statements for debugging
Returns
None
Example Code
Python
#Python code
import CoDrone_mini
drone = CoDrone_mini.CoDrone()
drone.pair() # pair automatically, may not always work
# drone.pair(debug=True) # sets the debug statements to True
# drone.pair(port_name = 'COM3') # pair with a specific port
drone.takeoff()
drone.hover(3)
drone.land()
drone.close()
Flight Commands (Start/Stop)
emergency_stop()
Description
This function immediately stops all commands and motors, so the drone will stop flying immediately. The function will also reset the flight motion variables to 0. NOTE: If you want to take off and emergency stop, it is recommended to run a hover()
or time.sleep()
in between the takeoff()
and emergency_stop()
, because the CoDrone Mini might miss the emergency_stop() command.
Syntax
emergency_stop()
Parameters
None
Returns
None