With it being that close I'm quite certain that is the source of your problems. Any little bit of heat and the sensor will find it.
With it being that close I'm quite certain that is the source of your problems. Any little bit of heat and the sensor will find it.
hello dears..
May anyone helps me to get the code of the ds18b20 on proton ide that will show me the temperature on a graphical lcd?I used this one but it's not working can anyone find the error in this code??
Device 16F877
XTAL=4
Declare LCD_DTPORT PORTB
Declare LCD_RSPIN PORTC.7
Declare LCD_RWPIN PORTC.6
Declare LCD_ENPIN PORTC.5
Declare LCD_CS1PIN PORTC.4
Declare LCD_CS2PIN PORTC.3
Declare LCD_TYPE GRAPHIC
GLCD_CS_INVERT On
INTERNAL_FONT On
FONT_ADDR=0
Declare ADIN_RES 10
Declare ADIN_TAD 2_FOSC
Declare ADIN_STIME 50
ADCON1 = %10000000
TRISA = $ff
TRISB = $00
TRISC =%11000000
TRISD =%11000000
DelayMS 200
Dim SPTemperature As Word ' scratchpad temperature storage
Dim Reserved0 As Byte ' scratchpad reserved variable
Dim Reserved1 As Byte ' scratchpad reserved variable
Dim Reserved2 As Byte ' scratchpad reserved variable
Dim Reg_TH As Byte ' scratchpad TH register or User Byte 1
Dim Reg_TL As Byte ' scratchpad TL register or User Byte 2
Dim Reg_Config As Byte ' scratchpad configuration register
Dim CRC As Byte ' scratchpad CRC register
Dim Temperature As Float ' temperature result
Symbol DQ = PORTD.1 ' one-wire data pin
While 1=1
OWrite DQ, 1, [$CC, $44] ' skip ROM search And start temperature conversion
While ORead DQ, 4 = 0 ' check for still busy converting
Wend
OWrite DQ, 1, [$CC, $BE] ' skip ROM search And read the temperature
ORead DQ, 0, [SPTemperature.LowByte, SPTemperature.HighByte, Reg_TH,Reg_TL,Reg_Config,Reserved0,Reserved1,Reser ved2,CRC]
Temperature = 0.0625 * SPTemperature ' convert to degrees C
Print At 1,1,@Temperature, "C",
Wend
End
Many thanks
Bookmarks