I'm trying to figure out how to control the micro servo, i'm using the example python code:
Code: Select all
def setServoPulse(channel, pulse):
pulseLength = 1000000 # 1,000,000 us per second
pulseLength /= 60 # 60 Hz
print "%d us per period" % pulseLength
pulseLength /= 4096 # 12 bits of resolution
print "%d us per bit" % pulseLength
pulse /= pulseLength
pwm.setPWM(channel, 0, pulse)
pwm.setPWMFreq(60) # Set frequency to 60 Hz
setServoPulse(0, 1000)
time.sleep(2)
setServoPulse(0, 1500)
time.sleep(2)
setServoPulse(0, 2000)
So if i'm right 1000 should be the -90, 1500 is the 0 position and 2000 is the 90 degree.
The problem is that, it doesn't seems to work like that, and also sometimes it rotate weird.
Thanks,
Gabor