A simpler Junior level function that represents flight with direction with more natural language. It simply flies in the given direction for a given duration and power.
go(direction, duration, power)
direction: an enum in Python. It’s the direction of the flight, which can be one of the following: FORWARD, BACKWARD, LEFT, RIGHT, UP, and DOWN.
duration: the duration of the flight motion in seconds. If undefined, defaults to run indefinitely.
power: the power at which the drone flies forward. Takes a value from 0 to 100. Defaults to 50 if not defined.
#Python code import CoDrone_mini from CoDrone_mini import Direction drone = CoDrone_mini.CoDrone() drone.pair() drone.takeoff() # Try each of these commands by uncommenting them #drone.go(Direction.FORWARD) # Go forward indefinitely at 50% power #drone.go(Direction.UP, 2) # Go up for 5 seconds at 50% power drone.go(Direction.BACKWARD, 3, 40) # Go backwards for 3 seconds at 70% power drone.land()