Am I on the right track?
the "//" operator will store the remainder in the chosen Var, thus:
Code:
ADCIN 4, volt ' Read AN4 into temp variable
volt = volt * 2 'Correct the ADCin for the Voltage divider?
FVolt = (5*volt/1023)
MVolt = (5*volt // 1023) 'millivolts?
lcdout $FE, $C0+8, dec FVolt,".",dec4 MVolt,"V"
Sorry for getting overly complex with this but trying to understand how it works, I have been able to simulate what I need to do in excel, just not sure if the above will work in PBP:
D1 = Vref @ 5.00
D5 = Adc Corrected @ 1021
D6 = 10 bit ADC @ 1024
D14 = Whole number (Formula =TRUNC(D9,0), result = 4
D15 = Remainder (Formula =(MOD((D5*D1)/D6,1)*1000)), result = 990
I could then LCDout D14, ".", D15 in theory if the formula in PBP equaled the excel result.
not sure though, still a bit confused
Cheers
Rob
Bookmarks