I've been successfully coding for this glowy thing without much problem. However I needed a method to quickly turn all channel LED's on and off when required.
Reading the datasheet for the PCA9685 there is a way to do this using the ALL_LED_ON and ALL_LED_OFF control (page 24 of the product data sheet).
I noticed that in the Adafruit_PWM_Servo_Driver.py code you have some global definitions in the PWM class referring to the register addresses for these controls but they're not implemented.
So I added a couple of def's to the driver code to do this.
The def to turn all off appears to work as expected:
def allOFF(self):
self.i2c.write8(self.__ALLLEDOFF_L,0x00)
self.i2c.write8(self.__ALLLEDOFF_H,0x10)
but I can't get them all to turn on with the following:
def allON(self):
self.i2c.write8(self.__ALLLEDON_L,0x00)
self.i2c.write8(self.__ALLLEDON_H,0x10)
Any ideas?
Adafruit PWM/Servo Driver - 16 Channel 12 BIT - ALLON/ALLOFF
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 4
- Joined: Thu Dec 05, 2013 4:49 pm
-
- Posts: 4
- Joined: Thu Dec 05, 2013 4:49 pm
Re: Adafruit PWM/Servo Driver - 16 Channel 12 BIT - ALLON/AL
<bump>
Can no one help on this?
Can no one help on this?
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit PWM/Servo Driver - 16 Channel 12 BIT - ALLON/AL
There is an "OE" Output Enable pin on the board. It has a pulldown resistor to enable by default. You can drive that high to turn off all the outputs.
-
- Posts: 4
- Joined: Thu Dec 05, 2013 4:49 pm
Re: Adafruit PWM/Servo Driver - 16 Channel 12 BIT - ALLON/AL
Thanks Bill
Turning them all off isn't a problem, I can do that with the function I've highlighted above. It's turning them all on that doesn't appear to work.
I'm sure I just using the wrong register value but can't work it out.
Turning them all off isn't a problem, I can do that with the function I've highlighted above. It's turning them all on that doesn't appear to work.
I'm sure I just using the wrong register value but can't work it out.
- adafruit_support_bill
- Posts: 88093
- Joined: Sat Feb 07, 2009 10:11 am
Re: Adafruit PWM/Servo Driver - 16 Channel 12 BIT - ALLON/AL
Using the OE pin, turning them back on is just a matter of toggling the pin.
I haven't played with the ALL_ON/ALL_OFF registers, but they work much differently than the OE pin.
The OE pin will toggle the leds to OFF and back to their previously programmed brightness. ALL_ON and ALL_OFF are used to set the on/off time intervals within the PWM cycle. When you use these commands, all 16 channels will be set to the same PWM duty cycle.
I haven't played with the ALL_ON/ALL_OFF registers, but they work much differently than the OE pin.
The OE pin will toggle the leds to OFF and back to their previously programmed brightness. ALL_ON and ALL_OFF are used to set the on/off time intervals within the PWM cycle. When you use these commands, all 16 channels will be set to the same PWM duty cycle.
Please be positive and constructive with your questions and comments.