pair()
#
DescriptionThis function pairs the BLE board to the CoDrone. After establishing a connection, it always waits for 3 seconds before executing the next command. Pair works a bit differently between Arduino and Python. With the Arduino-based remote, pair()
with no parameters will pair with the last paired CoDrone. If it's your first time using the remote, it will just find the nearest CoDrone it can find, then "lock in" with that CoDrone and always pair with it. With Python, pair()
with no parameters will pair with the last paired CoDrone, which is saved in a file called "PairInfo." If it's your first time running pair()
, it will just find the nearest CoDrone it can find, then "lock in" with that CoDrone, save it to "PairInfo" and always pair with it until you run pair(drone.Nearest)
.
#
Syntaxpair()
Arduino: pair(Nearest)
, Python: pair(drone.Nearest)
Arduino: pair(bluetoothAddress)
, Python: pair(fourDigitAddress)
#
ParametersNearest: If you specify Nearest
in Arduino or drone.Nearest
in Python, it will pair with the first drone it finds (which may not always be the nearest CoDrone, in some cases, just the first CoDrone it finds). This function can be used to "unlock" the drone from only pairing with the CoDrone it's been "locked in" with. Once you've paired with a nearest CoDrrone, you can run pair()
again with no parameters, and it will only pair with the "locked in" CoDrone.
address: This is the address of the CoDrone. In Arduino, this is a 6-index array of bytes representing the Bluetooth address. In Python, this is the 4-digit number that identifies the CoDrone.
#
ReturnsNone