I want to make smooth move with servo motor from 0 to 180 degrees and vice versa. I only know three values: 2.5 duty cycles for 0 degrees,7.5 duty cycles for 90 degrees and 12.5 duty cycles for 180 degrees. I want to make smooth move between all angles so i want some sort of function that return the duty cycle for every angle. I found this function Dc(d)=d/10+2.5, but it doesn't work.
I use these command to set a pwm pin
GPIO.setup(servo,GPIO.OUT)
pwm2 = GPIO.PWM(servo,50)