How to divide by 3.6 in basic stamp?
CuriousOne
Posts: 931
Hello.
I'm doing some experiments with lithium battery capacity measuring device using basic stamp. It is very simple, uses MAX7219 as display decoder and 4 segment 7 char LED. However, for accurate capacity display in mAh I need to divide variable by 3.6, which is not supported by stamps. The workaround is to X*10/36, but the problem is, the situation where X*10>65536 will be often, so it does not works. even X*5/18 does not works. X*3/11 may work, but will give bad precision.
Any ideas?
I'm doing some experiments with lithium battery capacity measuring device using basic stamp. It is very simple, uses MAX7219 as display decoder and 4 segment 7 char LED. However, for accurate capacity display in mAh I need to divide variable by 3.6, which is not supported by stamps. The workaround is to X*10/36, but the problem is, the situation where X*10>65536 will be often, so it does not works. even X*5/18 does not works. X*3/11 may work, but will give bad precision.
Any ideas?
Comments
Cheers,
I'm gussing it would be ** 18205 to divide by 3.6
x = x ** 18205
Bean