Quantcast
Channel: ArduPilot Discourse - Latest topics
Viewing all articles
Browse latest Browse all 46061

Mission Planner servo test works, but Python script does nothing

$
0
0

@AdamWex wrote:

I'm working on APM 2.5 retroware. Mission Planner 1.3.44, ArduCopter 3.2.1. I attached a servo to my power distribution board and RC10. Then I ran the following code:

def CountDown (phrase,maxcount): #This just makes an announcement and does a countdown
print phrase
for value in range(maxcount,0,-1):
print value
Script.Sleep(1000)

payload_servo = 10
CountDown("Servo test 1",3)
Script.SendRC(payload_servo,1200,True)
CountDown("Servo test 2",3)
Script.SendRC(payload_servo,1500,True)

I get the two messages and the countdown, but the Script.SendRC's do nothing. When I test the servos at the MP's Servo tab, they work just fine, clockwise for low and counterclockwise for high. I checked that under Config/Tuning RC10_FUNCTION is set to 0. Later I changed RC10_TRIM to 1500, but my script still didn't do anything. My code seems awfully short to not work. Am I missing something? (Also, how can I make my code show up as code in the forum?)

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 46061

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>