fixed wrong calculation of read pwm frequency

some more error handling
This commit is contained in:
Giovanni Harting
2015-11-14 14:35:42 +01:00
parent db379ccdf0
commit 7d6d289178
2 changed files with 12 additions and 8 deletions

View File

@@ -117,7 +117,7 @@ class Controller(Base):
@property
def pwm_freq(self):
self._pwm_freq = (self.bus.read_byte_data(self._address, PCA9685_PRESCALE) + 1) / 4096 * 25000000
self._pwm_freq = round(390625 / ((self.bus.read_byte_data(self._address, PCA9685_PRESCALE) + 1) * 64))
return self._pwm_freq
@pwm_freq.setter