
Originally Posted by
skimask
' **Setting for ADC of 16F88**
Define ADC_BITS 10 ' 10-bit ADC used
Define ADC_CLOCK 3 ' Internal clock used
Define ADC_SAMPLEUS 50 ' Sample timing
Samples var word:Sample var byte:Vin var Word:Samples=0
ADCloop:
For Sample=1 to 10:ADCIN 2,Vin:Samples=Samples + Vin:Pause 200 Next sample
Vin=Samples/10:Vin=(Vin*/500)>>2:Lcdout $fe, 1:LCDOUT $FE,2
Lcdout "Temp=",DEC (Vin DIG 2),DEC (Vin DIG 1),".",DEC (Vin dig 0),"C"
Samples=0:goto ADCLoop
It's not show corect.
I try the code below and work but the decimal change every 0.5C
How change to have resolution every 0.1C
Code:
Quanta Con 1250
ADCIN 2,AD_Result ' Place the conversion of channel0 into AD_RESULT
Volts = (AD_RESULT*10) */ Quanta
Lcdout $FE,1
Lcdout "Temp : ",dec1 Volts DIG 3,DEC1 Volts DIG 2,".",DEC1 Volts DIG 1,DEC1 Volts DIG 0,"C"
' So as to display like "23.4C"
Bookmarks