is_ready_to_fly() / isReadyToFly()

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

def main(): 
    drone = CoDrone.CoDrone()
    drone.pair()

    #land if flying.
    if drone.is_ready_to_fly():
        drone.takeoff()

if __name__ == '__main__':
    main()
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(){

}