Update to code

Needs testing
This commit is contained in:
shrkey
2016-08-13 20:17:22 +01:00
parent 4bcc4ff404
commit 0bb9e2a7c6
5 changed files with 99 additions and 31 deletions

View File

@@ -58,7 +58,7 @@ def software_reset(i2c=None, **kwargs):
"""Sends a software reset (SWRST) command to all servo drivers on the bus."""
# Setup I2C interface for device 0x00 to talk to all of them.
if i2c is None:
import Adafruit_GPIO.I2C as I2C
import I2C as I2C
i2c = I2C
self._device = i2c.get_i2c_device(0x00, **kwargs)
self._device.writeRaw8(0x06) # SWRST
@@ -71,7 +71,7 @@ class PCA9685(object):
"""Initialize the PCA9685."""
# Setup I2C interface for the device.
if i2c is None:
import Adafruit_GPIO.I2C as I2C
import I2C as I2C
i2c = I2C
self._device = i2c.get_i2c_device(address, **kwargs)
self.set_all_pwm(0, 0)