If ADC value of 819 equals say 15.9mA then just do some math to convert 819 into 159 and remember there is one decimal place in your answer which needs attention whenever you display...
819*1942/10000=159
so...
The variables...
ADCValue var Word
TempA var Word
TempB var Word
Result var Word
The Calculation (see PBP manual section 4.17.8 DIV32 command)...
TempA=1942
TempB=ADCValue*TempA
Result=DIV32 10000
The display (see PBP manual 4.17.7 DIG command)...
LCDOut $FE,1
If Result>99 then LCDOut #Result DIG 2
LCDout #Result DIG 1,".",#Result DIG 0,"mA"
Your display will show... 15.9mA
Bookmarks