Skip to main content

is_ready_to_fly()

Description#

This function checks whether the drone is ready to fly by returning a boolean.
The drone is ready to fly if it is oriented right-side up, and not flying.

Syntax#

Python: is_ready_to_fly()
Arduino: isReadyToFly()

Parameters#

None

Returns#

Boolean of whether the drone is ready to fly.

Example Code#
Python#
#Python code
import CoDrone
drone = CoDrone.CoDrone()
drone.pair()
#land if flying.
if drone.is_ready_to_fly():
drone.takeoff()
drone.land()
drone.close()
Arduino#
//Arduino code
#include<CoDrone.h> //header
void setup(){
//open serial and connect
CoDrone.begin(115200);
CoDrone.pair(Nearest);
// if drone is ready to fly, take off the drone
if(CoDrone.isReadyToFly() == true)
CoDrone.takeoff()
}
void loop(){
}