Esempio n. 1
0
def servoControl(angle, pinNum):
    pwm = GPIO(pinNum, 50)
    slope = (1 / 18)  #need to adjust slope based on calibration of our motor
    constant = 2  #constant will also need to be calibrated
    dutyCycle = slope * angle - constant
    pwm.ChangeDutyCycle(dutyCycle)