I use Pic Basic Pro. (software compiler) (BASIC)
You can download the manual.
PIC-1 has 8 buttons connected to an 8 bit port. It any button or buttons are pushed data is sent. 1110111= is button 4, 1110011= button 4,3 is pushed.
Data format = $,data,1/data,CR or $,11101111,00010000,CR
If data is sent then it is output on portB.
If no data is sent for 0.3 seconds then 11111111 is output on portB.
Here is most of the software for the receiver. (PIC-2)
'**********************************************************
'data= $, buttons, 1/buttons, CR
'button 5 pressed = $, 11101111, 00010000, CR
'if no command in .3 sec then release all buttons
'if button and 1/buttons do not equal or no CR then error
'**********************************************************
receiveloop:
HSERIN 300,timeout,[wait ("$")] '
hserin 30,timeout,[char1, char3]
'The Rx will wait for the $ then load from there.
high errorled 'turn off error led
if char3 <> cr then
low errorled 'indicate error
goto receiveloop
else
portb=char1 'push buttons
goto receiveloop
endif
timeout:
portb=$ff 'no buttons
high errorled 'reset error
toggle test 'test
goto receiveloop