debug servo code

This commit is contained in:
shrkey
2016-08-15 19:05:19 +01:00
parent 937856da09
commit 68435b7d55

View File

@@ -274,10 +274,10 @@ class dw_Servo:
self.off()
def setPWMmS(self, length_ms):
self.setPWM( round( length_ms * 4096 ) / ( 1000.0 / self.freq ) )
self.setPWM( math.trunc( ( length_ms * 4096 ) / ( 1000.0 / self.freq ) ) - 1 )
def setPWMuS(self, length_us):
self.setPWM( round( length_us * 4096 ) / ( 1000000.0 / self.freq ) )
self.setPWM( math.trunc( ( length_us * 4096 ) / ( 1000000.0 / self.freq ) ) -1 )