RPM Max = 12,000
STRAIN Max = 210
TORQUE Max = 143
I have version 2.44 of PicBasic Pro. Will 'LONG' work with this version? Should I upgrade?
Mark
RPM Max = 12,000
STRAIN Max = 210
TORQUE Max = 143
I have version 2.44 of PicBasic Pro. Will 'LONG' work with this version? Should I upgrade?
Mark
Upgrade yes... Check the website for more info...
12000 x 5252 x 210 x 143 = 1,892,610,720,000
Way too big for long's...
Like BrianT said, you'll have to figure out how to do some mathematic gymnastics to keep your numbers low enough to fit in 31/32 bits...
Or you could do it the old fashioned way, like back in 2nd grade...one number at a time, carry the result if needed...and so on and so on...
I guess it's up to you to figure out how much accuracy you really need/want...
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