what happened in your first example?
If you used DEC3, what was the results...apart that the decimal point was missing?
Now, i have set ADCON1 register to produce Right Justified results (ADCON1.7=1) and used this
Code:
ADCloop:
For Sample=1 to 10 ' Take 10 samples
ADCIN 0, Vin ' Read ADC ch-2 and save in Vin
' (range 0-1023)
Samples=Samples + Vin
Next sample
Vin=Samples/10 ' Mean of 10 Vin values
Vin=(Vin*/500)>>2
Lcdout $fe, 1 ' Clear LCD
LCDOUT $FE,2
Lcdout "Temp=",DEC Vin DIG 2, DEC Vin DIG 1,".", DEC1 VIN,"C"
Samples=0
PAUSE 100
goto ADCLoop
it worked.
EDIT: ARGH!
Bookmarks