def __init__(self, address=PCA9685_ADDRESS, bus=None, gpio_id="PCA9685"):
        I2CGPIODeviceDriver.__init__(self,address, bus, gpio_id)
        """Initialize the PCA9685."""
        # Setup I2C interface for the device.
        self.set_all_pwm(0, 0)
        self.i2c.write8(MODE2, OUTDRV)
        self.i2c.write8(MODE1, ALLCALL)
        time.sleep(0.005)  # wait for oscillator
        mode1 = self.i2c.read_U8(MODE1)
        mode1 = mode1 & ~SLEEP  # wake up (reset sleep)
        self.i2c.write8(MODE1, mode1)
        time.sleep(0.005)
def __init__ ( self , address = PCA9685_ADDRESS , bus = None , gpio_id = "PCA9685" ) : I2CGPIODeviceDriver . __init__ ( self , address , bus , gpio_id ) self . set_all_pwm ( 0 , 0 ) self . i2c . write8 ( MODE2 , OUTDRV ) self . i2c . write8 ( MODE1 , ALLCALL ) time . sleep ( 0.005 ) mode1 = self . i2c . read_U8 ( MODE1 ) mode1 = mode1 & ~ SLEEP self . i2c . write8 ( MODE1 , mode1 ) time . sleep ( 0.005 )
Initialize the PCA9685.