سلام دوستان
برنامه که در زیر قرار دادم.نمیدانم بهچه علت به sub هایی که تعریف کردمنمی رود.ممنون میشم اگر راهنمایی وکمکم کنید .
$regfile = "m16def.dat"
$crystal = 12000000
$baud = 9600
Enable Interrupts
Config Lcd = 16 * 4
Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7 , E = Portc.1 , Rs = Portc.0
Config Kbd = Portb , Debounce = 20 , Delay = 30
Config Adc = Single , Prescaler = Auto , Reference = Internal
Deflcdchar 0 , 12 , 18 , 18 , 12 , 32 , 32 , 32 , 32
Cursor Off
Config Portd = Output
Config Portd.6 = Output
Config Portd.7 = Output
Dim T As Byte
C Alias Portd.6
H Alias Portd.7
Dim A As Byte
Dim Num As Byte
Cls
Do
A = Getkbd()
If A <> 16 Then
Num = Lookup(a , Number)
Locate 4 , 1
Lcd Num
Waitms 500
End If
If Num = 2 Then
If Num = 3 Then
Gosub M.h
Elseif Num = 4 Then
Gosub M.c
End If
Locate 1 , 1
Lcd "test"
Waitms 500
End If
Loop
End
'/////////////////////////////////////////////////
M.h:
Lcd " heat"
Waitms 500
Set H
Reset C
Return
M.c:
Locate 3 , 1
Lcd " Fan"
Waitms 500
Set C
Reset H
Return
Number:
Data 7 , 4 , 1 , 10 , 8 , 5 , 2 , 0 , 9 , 6 , 3 , 11 , 15 , 14 , 13 , 12