Value can't be bigger than the ((middle value+1) *4)-1.
So for a middle value of 255, maximum value is 256*4 = 1024 -1 = 1023. The '10 bit' maximum for the chip.
Your formula is basically right, except for needing a division by 100.
value = (%/100) *(250+1) *4 -1
100% = 1003
50% = 501
You've lost a '0' in your 100% calculation.
Best Wishes
luismramirez
Joined: 17 Feb 2011 Posts: 8
Posted: Wed Apr 06, 2011 11:47 am
Thank you!
However, your formula has a "-1" at the end.
The one at the first page doesn't.
All times are GMT - 6 Hours Goto page Previous1, 2
Page 2 of 2
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum