$regfile = "M16def.dat"
$crystal = 1000000
$baud = 9600
'---------------------------------------------------
Config Lcdpin = Pin , Db7 = Pina.7 , Db6 = Pina.6 , Db5 = Pina.5 , Db4 = Pina.4 , E = Pina.3 , Rs = Pina.2
Config Lcd = 16 * 2
'---------------------------------------------------
Dim A(10) As Byte , I As Byte , T As Byte , B As Byte , Receive As String * 100 , Ant As Byte
'---------------------------------------------------
Enable Interrupts
Enable Urxc
On Urxc Receive_program
'---------------------------------------------------
Config Pinb.0 = Input
'---------------------------------------------------
Cls
Home
Lcd "salam"
Wait 2
Cls
'---------------------------------------------------
A(1) = 162
A(2) = 51
A(3) = 91
A(4) = 120
A(5) = 20
'---------------------------------------------------
Do
Debounce Pinb.0 , 1 , Ant , Gosub
Loop
'---------------------------------------------------
Ant:
Printbin 85 ; 13
Cls
For I = 1 To 5
Printbin A(i)
Lcd Chr(a(i))
Lcd " "
Next
Printbin 13
Return
'---------------------------------------------------
Receive_program:
B = Inkey()
If B = 13 Then :
Lcd Receive
Waitms 50
Ant = 1
Else :
If Ant = 1 Then :
Receive = Chr(b) : Ant = 0
Else :
Receive = Receive + Chr(b)
End If
End If
Return