با سلام خدمت تمامی دوستان
من با فشار دادن هر دکمه ی روی KeyPad ، در بیشتر مواقع عدد 255 و 254 و یا اعداد 194 و ... رو روی LCD مشاده می کنم و عددی که با HM-TR فرستنده ارسال کرده ام رو نمی توانم روی LCD به نمایش در بیاورم ، من با String هم برای ارسال کلمه استفاده کردم ولی موفق نشدم برنامه رو در زیر گزاشته ام
فرستنده :
$regfile = "m32def.dat"
$crystal = 8000000
Config Lcdpin = Pin , Db4 = Pinc.3 , Db5 = Pinc.2 , Db6 = Pinc.1 , Db7 = Pinc.0 , Rs = Pinc.4 , E = Pinc.5
Config Lcd = 16 * 2
Config Kbd = Porta
$baud = 9600
Dim A As Byte
Dim Key As Byte
Dim S0 As Byte
Dim S1 As Byte
Dim S2 As Byte
Dim S3 As Byte
Dim S4 As Byte
Dim S5 As Byte
Dim S6 As Byte
Dim S7 As Byte
Dim S8 As Byte
Dim S9 As Byte
S0 = 0
S1 = 1
S2 = 2
S3 = 3
S4 = 4
S5 = 5
S6 = 6
S7 = 7
S8 = 8
S9 = 9
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd "Design By Masood"
Main:
Do
Key = Getkbd()
If Key < 16 Then
If Key = 2 Then Goto 0
If Key = 15 Then Goto 1
If Key = 14 Then Goto 2
If Key = 13 Then Goto 3
If Key = 11 Then Goto 4
If Key = 10 Then Goto 5
If Key = 9 Then Goto 6
If Key = 7 Then Goto 7
If Key = 6 Then Goto 8
If Key = 5 Then Goto 9
End If
Do
Key = Getkbd()
Loop Until Key = 16
Loop
0:
Print S0
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd S0
Goto Main
1:
Print S1
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd S1
Goto Main
2:
Print S2
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd S2
Goto Main
3:
Print S3
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd S3
Goto Main
4:
Print S4
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd S4
Goto Main
5:
Print S5
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd S5
Goto Main
6:
Print S6
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd S6
Goto Main
7:
Print S7
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd S7
Goto Main
8:
Print S8
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd S8
Goto Main
9:
Print S9
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd S9
Goto Main
گیرنده:
$regfile = "m32def.dat"
$crystal = 8000000
Config Lcdpin = Pin , Db4 = Pinc.3 , Db5 = Pinc.2 , Db6 = Pinc.1 , Db7 = Pinc.0 , Rs = Pinc.4 , E = Pinc.5
Config Lcd = 16 * 2
Config Portb = Output
$baud = 9600
Dim S As Byte
Set Portb.0
Cursor Off
Cls
Locate 1 , 1
Lcd "Receved By HM-TR"
Locate 2 , 1
Lcd " No Data "
Main:
Do
Input S
Cls
Lcd S
If S = 1 Then Goto 1
If S = 2 Then Goto 0
Loop
1:
Reset Portb.0
Goto Main
0:
Set Portb.0
Goto Main
من با فشار دادن هر دکمه ی روی KeyPad ، در بیشتر مواقع عدد 255 و 254 و یا اعداد 194 و ... رو روی LCD مشاده می کنم و عددی که با HM-TR فرستنده ارسال کرده ام رو نمی توانم روی LCD به نمایش در بیاورم ، من با String هم برای ارسال کلمه استفاده کردم ولی موفق نشدم برنامه رو در زیر گزاشته ام
فرستنده :
$regfile = "m32def.dat"
$crystal = 8000000
Config Lcdpin = Pin , Db4 = Pinc.3 , Db5 = Pinc.2 , Db6 = Pinc.1 , Db7 = Pinc.0 , Rs = Pinc.4 , E = Pinc.5
Config Lcd = 16 * 2
Config Kbd = Porta
$baud = 9600
Dim A As Byte
Dim Key As Byte
Dim S0 As Byte
Dim S1 As Byte
Dim S2 As Byte
Dim S3 As Byte
Dim S4 As Byte
Dim S5 As Byte
Dim S6 As Byte
Dim S7 As Byte
Dim S8 As Byte
Dim S9 As Byte
S0 = 0
S1 = 1
S2 = 2
S3 = 3
S4 = 4
S5 = 5
S6 = 6
S7 = 7
S8 = 8
S9 = 9
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd "Design By Masood"
Main:
Do
Key = Getkbd()
If Key < 16 Then
If Key = 2 Then Goto 0
If Key = 15 Then Goto 1
If Key = 14 Then Goto 2
If Key = 13 Then Goto 3
If Key = 11 Then Goto 4
If Key = 10 Then Goto 5
If Key = 9 Then Goto 6
If Key = 7 Then Goto 7
If Key = 6 Then Goto 8
If Key = 5 Then Goto 9
End If
Do
Key = Getkbd()
Loop Until Key = 16
Loop
0:
Print S0
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd S0
Goto Main
1:
Print S1
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd S1
Goto Main
2:
Print S2
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd S2
Goto Main
3:
Print S3
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd S3
Goto Main
4:
Print S4
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd S4
Goto Main
5:
Print S5
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd S5
Goto Main
6:
Print S6
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd S6
Goto Main
7:
Print S7
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd S7
Goto Main
8:
Print S8
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd S8
Goto Main
9:
Print S9
Cls
Locate 1 , 1
Lcd " Send S By HM-TR"
Locate 2 , 1
Lcd S9
Goto Main
گیرنده:
$regfile = "m32def.dat"
$crystal = 8000000
Config Lcdpin = Pin , Db4 = Pinc.3 , Db5 = Pinc.2 , Db6 = Pinc.1 , Db7 = Pinc.0 , Rs = Pinc.4 , E = Pinc.5
Config Lcd = 16 * 2
Config Portb = Output
$baud = 9600
Dim S As Byte
Set Portb.0
Cursor Off
Cls
Locate 1 , 1
Lcd "Receved By HM-TR"
Locate 2 , 1
Lcd " No Data "
Main:
Do
Input S
Cls
Lcd S
If S = 1 Then Goto 1
If S = 2 Then Goto 0
Loop
1:
Reset Portb.0
Goto Main
0:
Set Portb.0
Goto Main
دیدگاه