i think rc5in is not a valid command in proton ide
Yes it is
----------------------------from the Help file------------
Variable = RC5IN
Receive Philips RC5 infrared data from a predetermined pin. The pin is automatically made an input.
Variable - a bit, byte, word, dword, or float variable, that will be loaded by RC5In. The return data from the RC5In command consists of two bytes, the SYSTEM byte containing the type of remote used. i.e. TV, Video etc, and the COMMAND byte containing the actual button value. The order of the bytes is COMMAND (low byte) then SYSTEM (high byte). If a byte variable is used to receive data from the infrared sensor then only the COMMAND byte will be received.
Device = 16F877
RC5IN_PIN = PORTC.0 ' Choose the port and pin for the infrared sensor
DIM RC5_WORD as WORD ' Create a WORD variable to receive the data
DIM RC5_COMMAND as RC5_WORD.Lowbyte ' Alias the COMMAND byte to RC5_WORD low byte
DIM RC5_SYSTEM as RC5_WORD.Highbyte ' Alias the COMMAND byte to RC5_WORD high byte
ALL_DIGITAL = ON ' Make all pins digital mode
Cls ' Clear the LCD
While 1 = 1 ' Create an infinite loop
RC5_WORD = RC5In ' Receive a signal from the infrared sensor
Until RC5_COMMAND<> 255 ' Keep looking until a valid header found
Print at 1,1,"SYSTEM ",Dec RC5_SYSTEM," " ' Display the SYSTEM value
Print at 2,1,"COMMAND ",Dec RC5_COMMAND," " ' Display the COMMAND value
There is a single Declare for use with RC5In: -
DECLARE RC5IN_PIN PORT . PIN
Assigns the Port and Pin that will be used to input infrared data by the RC5In command. This may be any valid port on the PICmicro.
If the Declare is not used in the program, then the default Port and Pin is PORTB.0.
The RC5In command will return with both COMMAND and SYSTEM bytes containing 255 if a valid header was not received. The CARRY (STATUS.0) flag will also be set if an invalid header was received. This is an ideal method of determining if the signal received is of the correct type.
RC5In is oscillator independent as long as the crystal frequency is declared at the top of the program. If no XTAL Declare is used, then RC5In defaults to a 4MHz crystal frequency for its timing.