last question....why the temperature going to high....oC and my LCD cant display any oC when going to low oC the LCD can display bck the value....why...! is my progrme problme...or what happen who can let me knw below is my new programe....!!!!
help to check it
'************************************************* ***************
'* Name : UNTITLED.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2008 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 1/23/2008 *
'* Version : 1.0 *
'* Notes : *
'* : *
'************************************************* ***************
Define LCD_DREG PORTB
Define LCD_DBIT 4
Define LCD_RSREG PORTB
Define LCD_RSBIT 0
Define LCD_EREG PORTB
Define LCD_EBIT 1
' Define ADCIN parameters '
Define ADC_BITS 8 ' Set number of bits in result
Define ADC_CLOCK 3 ' Set clock source (3=rc)
Define ADC_SAMPLEUS 50 ' Set sampling time in uS
include"modedefs.bas"
TRISB=%11111111
pause 2
LCDOUT 254,1,2,2,2,"WELCOME MY"
LCDOUT 254,192,2,"MONITOR SYSTEM"
pause 3
LCDOUT 254,1,"MY STARTING"
LCDOUT 254,192,2,2,2,2,2,"TEMPERATURE"
B0 var byte ' Create TEMPERATURE to store result
TRISC.6=0
TRISA = %11111111 ' Set PORTA to all input
ADCON1 =%00001010 ' Set PORTA analog
Low PORTB.2 ' LCD R/W line low (W)
Pause 1000
loop:
ADCIN 0,B0 ' Read channel 0 to adval
Lcdout $fe, 1 ' Clear LCD
Lcdout "Value: ",DEC B0,"'C" ' Display the decimal value
serout portc.6,n2400,[#b0]
Pause 5000 ' Wait .5 second
Goto loop ' Do it forever
End
Bookmarks