Control servos with python Script Help.

Hi Guys I´ve written a simple python script, which activates a particular RC output (RC5 in this case) to set a connected servo to a specific angle, waits 2 seconds then to another angle then repeats.

Everything works perfectly in Manual mode.The servo connected to RC5 fires away as it should. However when in AUTO or STABILIZE mode, the Aileron and Elevator servos start moving as well and I can´t figure out why and was wondering if anyone could point me in the right direction.

My code is below in case anyone fancies a look

Thanks!!

Nick

import sys

from math import*
import clr
import time
import MissionPlanner

n = 0
while True:
time.sleep(2)
Script.SendRC(5,1150,True)#servo in pos 1
n += 1
print "== SERVO IN POS 1"
print "========================"
time.sleep(2)
Script.SendRC(5,1400,True)#servo in pos 2
n += 1
print "== SERVO IN POS 2"
print "========================"

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Activity