dat"
$crystal = 11059200
Config Lcdpin = Pin , Db4 = Portd.4 , Db5 = Portd.5 , Db6 = Portd.6 , Db7 = Portd.7 , E = Portd.3 , Rs =
Portd.2
Portb = &HFF
Config Lcd = 16 * 2
Dim S As Byte
Const Dly = 5
Start Adc
Cls
Cursor Off
S=0
Do
Hsl = Getadc(0)
Mv = Hsl * 5000
Mv = Mv / 1023
Tm = Mv / 10
Upperline
Lcd "Temp:" ; Tm
Lowerline
If S = 1 Then
Gosub Tutup
S=0
End If
End If
If Tm >= 41 Then
Lowerline
Gosub Buka
S=1
End If
End If
Loop
End
Buka:
Ptr = 13
For I = 1 To Ptr
Portc = &H80
Waitms Dly
Portc = &H40
Waitms Dly
Portc = &H20
Waitms Dly
Portc = &H10
Waitms Dly
Next I
Return
Tutup:
Ptr = 13
For I = 1 To Ptr
Portc = &H10
Waitms Dly
Portc = &H20
Waitms Dly
Portc = &H40
Waitms Dly
Portc = &H80
Waitms Dly
Next I
Return