Hello who can teach me how to add the calculation of the temperature in my programe i try many time ad still cant working.....i fast want die ad...few day no sleep ad....hope u all can help me...thanks...
'************************************************* ***************
'* Name : UNTITLED.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2008 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 1/25/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,"WELCOME MY"
LCDOUT 254,192,"MONITOR SYSTEM"
pause 3
LCDOUT 254,1,"MY STARTING"
LCDOUT 254,192,"TEMPERATURE"
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 5 ' Wait .5 second
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 1 ' Wait .1 second
Goto loop ' Do it forever
End
Bookmarks