I am trying to divide a number by a variable and am having trouble getting the accuracy that I would like. I have searched the forum and most of the answers are beyond my understanding.
I need the following:
W4 = 7,500,000 / W0 ‘ Where 1,500 < W0 < 9,000
I came up with the following code, but any help would be appreciated:
W1 = 50000 / W0 * 150
W2 = 50000 // W0
IF W2 < 436 THEN aa
IF W2 < 655 THEN bb
IF W2 < 873 THEN cc
IF W2 < 1310 THEN dd
IF W2 < 2184 THEN ee
IF W2 < 2621 THEN ff
IF W2 < 4369 THEN gg
IF W2 < 6553 THEN hh
IF W2 < 13106 THEN ii
IF W2 < 32767 THEN jj
GOTO zz
aa:
W3 = W2 * 150 / W0
GOTO zz
bb:
W3 = W2 * 100 / W0 * 3 / 2
GOTO zz
cc:
W3 = W2 * 75 / W0 * 2
GOTO zz
dd:
W3 = W2 * 50 / W0 * 3
GOTO zz
ee:
W3 = W2 * 30 / W0 * 5
GOTO zz
ff:
W3 = W2 * 25 / W0 * 6
GOTO zz
gg:
W3 = W2 * 15 / W0 * 10
GOTO zz
hh:
W3 = W2 * 10 / W0 * 15
GOTO zz
ii:
W3 = W2 * 5 / W0 * 30
GOTO zz
jj:
W3 = W2 * 2 / W0 * 75
zz:
W4 = W1 + W3
Jeremy Leach’s answer in “Help caculating RPM with Pulsin command on PICAXE-8M” is very close to what I need but it does not work for me.
“Drag Strip Timer” is also similar to what I need, but I still need help.
I need the following:
W4 = 7,500,000 / W0 ‘ Where 1,500 < W0 < 9,000
I came up with the following code, but any help would be appreciated:
W1 = 50000 / W0 * 150
W2 = 50000 // W0
IF W2 < 436 THEN aa
IF W2 < 655 THEN bb
IF W2 < 873 THEN cc
IF W2 < 1310 THEN dd
IF W2 < 2184 THEN ee
IF W2 < 2621 THEN ff
IF W2 < 4369 THEN gg
IF W2 < 6553 THEN hh
IF W2 < 13106 THEN ii
IF W2 < 32767 THEN jj
GOTO zz
aa:
W3 = W2 * 150 / W0
GOTO zz
bb:
W3 = W2 * 100 / W0 * 3 / 2
GOTO zz
cc:
W3 = W2 * 75 / W0 * 2
GOTO zz
dd:
W3 = W2 * 50 / W0 * 3
GOTO zz
ee:
W3 = W2 * 30 / W0 * 5
GOTO zz
ff:
W3 = W2 * 25 / W0 * 6
GOTO zz
gg:
W3 = W2 * 15 / W0 * 10
GOTO zz
hh:
W3 = W2 * 10 / W0 * 15
GOTO zz
ii:
W3 = W2 * 5 / W0 * 30
GOTO zz
jj:
W3 = W2 * 2 / W0 * 75
zz:
W4 = W1 + W3
Jeremy Leach’s answer in “Help caculating RPM with Pulsin command on PICAXE-8M” is very close to what I need but it does not work for me.
“Drag Strip Timer” is also similar to what I need, but I still need help.