Hello all,
I am trying to use RF module with PIC12f675.
My code till now.
TX CODE:
********************************************************************
Dim i As Byte
CMCON = 7
TRISIO = %00001111
Symbol led = GPIO.5
loop:
led = 0
If GPIO.3 = 0 Then
Serout GPIO.4, 9600, "1", CrLf
Toggle led
Endif
If GPIO.0 = 0 Then
Serout GPIO.4, 9600, "2", CrLf
Toggle led
Endif
If GPIO.1 = 0 Then
Serout GPIO.4, 9600, "3", CrLf
Toggle led
Endif
If GPIO.2 = 0 Then
Serout GPIO.4, 9600, "4", CrLf
Toggle led
Endif
Goto loop
*********************************************************
RX CODE:
*********************************************************
Dim i As Byte
Symbol led = GPIO.0
CMCON = 7
TRISIO = %00100000
GPIO.1 = 0
GPIO.2 = 0
loop:
led = 0
Serin GPIO.5, 9600, i
If i > 0 Then
Gosub check
Else
Gosub loop
Endif
check:
If i = "1" Then
GPIO.1 = 1
Toggle led
Else
If i = "2" Then
GPIO.1 = 0
Toggle led
Else
If i = "3" Then
GPIO.2 = 1
Toggle led
Else
If i = "4" Then
GPIO.2 = 0
Toggle led
Endif
Endif
Endif
Endif
Gosub loop
End
************************************************************************
This code works perfect....
Instead of one digit i want to send say ten digit at the press of a button.
how to ?? any idea shall be good
Thanx in advance.
Mastero
I am trying to use RF module with PIC12f675.
My code till now.
TX CODE:
********************************************************************
Dim i As Byte
CMCON = 7
TRISIO = %00001111
Symbol led = GPIO.5
loop:
led = 0
If GPIO.3 = 0 Then
Serout GPIO.4, 9600, "1", CrLf
Toggle led
Endif
If GPIO.0 = 0 Then
Serout GPIO.4, 9600, "2", CrLf
Toggle led
Endif
If GPIO.1 = 0 Then
Serout GPIO.4, 9600, "3", CrLf
Toggle led
Endif
If GPIO.2 = 0 Then
Serout GPIO.4, 9600, "4", CrLf
Toggle led
Endif
Goto loop
*********************************************************
RX CODE:
*********************************************************
Dim i As Byte
Symbol led = GPIO.0
CMCON = 7
TRISIO = %00100000
GPIO.1 = 0
GPIO.2 = 0
loop:
led = 0
Serin GPIO.5, 9600, i
If i > 0 Then
Gosub check
Else
Gosub loop
Endif
check:
If i = "1" Then
GPIO.1 = 1
Toggle led
Else
If i = "2" Then
GPIO.1 = 0
Toggle led
Else
If i = "3" Then
GPIO.2 = 1
Toggle led
Else
If i = "4" Then
GPIO.2 = 0
Toggle led
Endif
Endif
Endif
Endif
Gosub loop
End
************************************************************************
This code works perfect....
Instead of one digit i want to send say ten digit at the press of a button.
how to ?? any idea shall be good
Thanx in advance.
Mastero