A few changes

Added correction factor
Change motor test code
This commit is contained in:
shrkey
2016-08-15 21:21:43 +01:00
parent 95d9be87cd
commit d56cf2f666
3 changed files with 17 additions and 14 deletions

View File

@@ -96,7 +96,7 @@ class PCA9685(object):
oldmode = self._device.readU8(MODE1);
newmode = (oldmode & 0x7F) | 0x10 # sleep
self._device.write8(MODE1, newmode) # go to sleep
self._device.write8(PRESCALE, prescale)
self._device.write8(PRESCALE, int(math.floor(prescale)))
self._device.write8(MODE1, oldmode)
time.sleep(0.005)
self._device.write8(MODE1, oldmode | 0x80)

View File

@@ -227,6 +227,9 @@ class dw_Motor:
if (command == dw_Controller.RELEASE):
self.MC.setPin(self.PHpin, 0)
self.MC.setPin(self.ENpin, 0)
def off(self):
elf.run(dw_Controller.RELEASE, 0)
class dw_Servo:
def __init__(self, controller, num, freq):