我想用树莓派代替电调信号发生器发送PWM波控制螺旋桨转速,但螺旋桨根本转不起来,以下是我的python代码,请帮忙看看哪里出了问题,谢谢!
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setup(29,GPIO.OUT)
p=GPIO.PWM(29,50)
p.start(7.5)
time.sleep(2)
try:
while(True):
p.ChangeDutyCycle(9)
time.sleep(5)
p.ChangeDutyCycle(7.5)
time.sleep(5)
except KeyboardInterrupt:
pass
p.stop()
GPIO.cleanup()