Hi,
I had a system that used a byte variable to store the PWM value to fade up and down some leds. It worked well, but having 0-255 the resolution was very noticeable, especially at low values. I now have a chip that communicates over I2C and can drive 12 PWM outputs with a resolution of 4096 steps. The problem is that with a word variable in a similar situation is 0 - 65335 and the device ignores the first 4 bits according to the datasheet ( http://www.nxp.com/documents/data_sheet/PCA9685.pdf )
Can anyone advise how I can get the resolution to cover the 12bit word range and write this to the chip. I've tried
Code:
I2CWRITE SDApin,SCLpin,i2cWriteAddress,i2cControl,[0,0,pcaPwmValue.highbyte,pcaPwmValue.lowbyte >> 8]
But that doesn't work.
Bookmarks