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 diydrones2 to add comments!

Join diydrones2

Email me when people reply –

Activity

DIY Drones via Twitter
New! Online Training on Drones for Disaster Response https://t.co/brqRuujjY2
yesterday
DIY Robocars via Twitter
https://t.co/8EMCvYW6oz
yesterday
DIY Robocars via Twitter
RT @OttawaAVGroup: We are going to try something new this week. We will be having a drop-in style meeting Wednesday @ 7-9pm EST. Pop in and…
yesterday
DIY Robocars via Twitter
RT @tawnkramer: Thanks Everyone for another fun virtual race! Amazing Ai racers competing head-to-head, Virtual Makers Fair event. Catch us…
Sunday
DIY Robocars via Twitter
RT @make: Find out the latest from @diyrobocars at 10am PT from @chr1sa of @3DRobotics on Virtually Make Faire! #makerfaire #maketogether #…
Saturday
DIY Robocars via Twitter
RT @Heavy02011: Join us Saturday online: Virtual Race League: @DIYRobocars Race #2 - Parking Lot Nerds https://t.co/aJUu4sdutx #Meetup via…
Saturday
DIY Robocars via Twitter
RT @donkey_car: Yay, we are part of the virtual @makerfaire with @diyrobocars. Come see our race or better yet train a model and race with…
May 21
DIY Robocars via Twitter
RT @chr1sa: The @DIYRobocars Virtual AI Race is going to be part of the virtual @makerfaire on Sat! https://t.co/wnMDAboLID
May 20
DIY Robocars via Twitter
RT @tawnkramer: Please join us next week for our second DIYRobocars online race. We will be using a new Mountain Track course! https://t.co…
May 19
DIY Robocars via Twitter
RT @SmallpixelCar: I realized that the size of the cones in @diyrobocars is known. If we can detect the bounding box, which can be done wit…
May 19
DIY Drones via Twitter
RT @chr1sa: Our next @DIYRobocars autonomous car virtual race is this Saturday. Sign up here to compete or just spectate on @Twitch https:/…
May 19
DIY Drones via Twitter
Definitive Guide to Setup Drone Delivery System https://t.co/7ibwcgF24h
May 19
DIY Robocars via Twitter
RT @DAVGtech: The next @diyrobocars virtual robocar race is this Saturday. One of many interesting issues we are taking a stab at is "how c…
May 18
DIY Robocars via Twitter
RT @chr1sa: cc @DIYRobocars @donkey_car https://t.co/ewbyqZ3xC0
May 18
DIY Robocars via Twitter
RT @chr1sa: This is the technique that many of the @DIYRobocars racers use to estimate their localization position on the track https://t.c…
May 18
DIY Drones via Twitter
Fighter Hand throw fixed wing https://t.co/cwBPSsbePp
May 15
More…