I have the code below to show the temperature on LCD
The code works but i want to show on Lcd and the decimal value,
but i cann't
Like this : Temp=25.6C
Code:' **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 ' Samples Sample var byte ' Sample Vin var Word ' Vin is variable Samples=0 ADCloop: For Sample=1 to 10 ' Take 10 samples ADCIN 2, Vin ' Read ADC ch-2 and save in Vin ' (range 0-1023) Samples=Samples + Vin Pause 200 ' Wait for LCD to startup ' Seems to be appropriate. Next sample Vin=Samples/10 ' Mean of 10 Vin values Vin=(Vin*/500)>>2 Lcdout $fe, 1 ' Clear LCD LCDOUT $FE,2 Lcdout "Temp=",Dec2 Vin,"C" Samples=0 goto ADCLoop




Bookmarks