Skip to main content

get_throttle()

Description#

This is a getter function that gets the value of the throttle variable.

Syntax#

Python: get_throttle()
Arduino: getThrottle()

Parameters#

None

Returns#

The power of the throttle variable (int)

Example Code#
Python#
#Python code
import CoDrone
drone = CoDrone.CoDrone()
drone.pair()
# Print current throttle with getter function
print(“Current throttle :, drone.get_throttle())
drone.close()
Arduino#
//Arduino code
#include<CoDrone.h> //header
void setup(){
//open serial and connect
CoDrone.begin(115200);
CoDrone.pair(Nearest);
// save current throttle value in variable “current_throttle”
int current_throttle = CoDrone.getThrottle();
}
void loop(){
}