Divide by 5252, not multiply it.
RPM = 12000
STRAIN = 210
TORQUE = 140
VALUE = 5252
A = STRAIN * TORQUE
B = RPM
C= A * B
C= C DIV32 VALUE
Divide by 5252, not multiply it.
RPM = 12000
STRAIN = 210
TORQUE = 140
VALUE = 5252
A = STRAIN * TORQUE
B = RPM
C= A * B
C= C DIV32 VALUE
Another...'OH YEAH' moment just happened.
You've already got the 'torque' value multiplied up for the decimal point.
Disregard the stuff about x100/5252.
12000 x 210 x 143 = 360,360,000 which will fit into 31/32 bits even when getting maximum values.
Divide that by 5252 and you get 68613, which is 100x too much, right?
So divide that by 100, gives you 686, take the remainder (modulus) and you get 13.
Should be easy enough to display that (until you get to the leading zeros...PBP CAN handle that too if you read far enough into the LCDOUT and/or SEROUT section of the manual).
Bookmarks