Code: Select all
Wire.beginTransmission(I2CPWM);
present = Wire.endTransmission();
if (present==0)
{
//Do something, we got 8bit
}
else
{
//Do something, we got 16bit
}
Code: Select all
Wire.beginTransmission(I2CPWM);
present = Wire.endTransmission();
if (present==0)
{
//Do something, we got 8bit
}
else
{
//Do something, we got 16bit
}
Cool, I see that you do that with your Present variable now. Not sure where that var is read, but it makes sense.rimai wrote:The other way is to check for presence of the module like this:Code: Select all
Wire.beginTransmission(I2CPWM); present = Wire.endTransmission(); if (present==0) { //Do something, we got 8bit } else { //Do something, we got 16bit }
Seems like you could do that. You'd just have to know what address the Adafruit board is on and tweak the library files appropriately. It should be identical calls to talk to it as it is to talk to the one Roberto makes. It would be the defines in Globals.h for I2CPWM_PCA9685 which by default uses the address of 0x40 for his 6 channel PWM expansion. I don't know which board you have, but I bet it has jumpers to set the address.89delta wrote:So since the dimming expansion uses the PCA9685 chip that means I could use the Adafruit Servo Breakout Board that I already have correct. Don't care for all 16-channels though as 6 would be plenty. What would I need to do to get it up and running? I already made the usb cable for it with the correct pinouts.
Code: Select all
#define Mem_B_PWMSlopeStart0 VarsStart+58
#define Mem_B_PWMSlopeEnd0 VarsStart+59
#define Mem_B_PWMSlopeDuration0 VarsStart+60
#define Mem_B_PWMSlopeStart1 VarsStart+61
#define Mem_B_PWMSlopeEnd1 VarsStart+62
#define Mem_B_PWMSlopeDuration1 VarsStart+63
#define Mem_B_PWMSlopeStart2 VarsStart+64
#define Mem_B_PWMSlopeEnd2 VarsStart+65
#define Mem_B_PWMSlopeDuration2 VarsStart+66
#define Mem_B_PWMSlopeStart3 VarsStart+67
#define Mem_B_PWMSlopeEnd3 VarsStart+68
#define Mem_B_PWMSlopeDuration3 VarsStart+69
#define Mem_B_PWMSlopeStart4 VarsStart+70
#define Mem_B_PWMSlopeEnd4 VarsStart+71
#define Mem_B_PWMSlopeDuration4 VarsStart+72
#define Mem_B_PWMSlopeStart5 VarsStart+73
#define Mem_B_PWMSlopeEnd5 VarsStart+74
#define Mem_B_PWMSlopeDuration5 VarsStart+75