PBP and Math ...

Originally Posted by
aratti
Tray (Value * 0.313)+165
a) (0*0.313)+165 = 165
b) (255*0.313)+165 = 244.8
Since you don't need high accuracy it should work.
Al.
Hi,
With PbP ... I'd rather try :
Duty = ( Value * 5 /16 ) + 165
But it's just me ...
might better be PWM = (3.175 * Value ) - 523.875
OR PWM = ( 127 /40 * Value ) - ( 4191 / 8 )
PWM = (( 127 * value / 5 ) - 4191) >> 3
...
Alain
Last edited by Acetronics2; - 27th December 2008 at 20:08.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks