
Originally Posted by
HenrikOlsson
Hi,
Just remove the >> 8 part of it and see if it works.
/Henrik.
Henrik,
I just tried that with the the following:
Code:
pcaChannel = 0 ;Set a PWM channel
pcaPwmValue = B_PWM ;Send current value
lcdout $FE,$D4+0,"PWM ",dec pcaPwmValue
i2cControl = $6 + 4*pcaChannel ;LED0_ON_L $6
I2CWRITE SDApin,SCLpin,i2cWriteAddress,i2cControl,[0,0,1,pcaPwmValue]
I've run a test and that seems to work in as far as the LED on channel 0 fades up. What I did notice though was that the LCD continued to count up past 4095. Notice I placed a 1 as the value for the "ON" setting following Steve's comments. I'm hoping that is correct ?
I'm re-running the test as I missed the point where the LED on channel one went off. I'm hoping that it was when the value was close or exactly 4095, as at least that would prove the range that is being accepted. Just need to figure out how to specify the size of the variable as you suggest - any pointers ?
Bookmarks