1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

LP-483 Example tuning using accessory0 (by L Laurent)

This commit is contained in:
padeler 2017-03-23 02:17:01 +02:00
parent 364e24e59c
commit 775e2a4063

View File

@ -177,11 +177,11 @@ if __name__ == '__main__':
print
while True:
try:
# get update of ManualControlCommand
objMan.ManualControlCommand.getUpdate(timeout=.5)
# calculate value out of Accessory1 input (-1 ... +1)
txControl = objMan.ManualControlCommand.Accessory1.value
# get update of AccessoryDesired
objMan.AccessoryDesired.getUpdate(timeout=.5)
# calculate value out of Accessory0 input (-1 ... +1)
txControl = objMan.AccessoryDesired.AccessoryVal.value
value = tuneFrom + ((txControl+1)/2)*(tuneTo-tuneFrom)
PI[PIIndex] = value
objMan.StabilizationSettingsBank1.updated()