Name:
rfin
Syntax:

RFIN pin, variable, variable, variable, variable, variable, variable, variable, variable

Pin - is a variable/constant which specifies the i/o pin to use

Variables - are 8 individual byte variables to receive the 8 bytes of data

Description:

Receive 8 bytes of Manchester encoded radio data transmitted by a NKM2401 encoder or PICAXE rfout command over a wireless link. Note that the rfin command always receives exactly 8 bytes of data, so exactly 8 data variables are required within this command syntax.

The rfin command decodes and receives 8 bytes of data transmitter over a radio link from a NKM2401 encoder or rfout command from another PICAXE chip. This provides much more reliable radio communication than using serin commands with low cost RF modules.

Note this command is blocking, no other commands will process whilst the rfin command is waiting for RF data to be received. If a system that can process other commands whilst waiting for data to be received is required, the NKM2401 should be used as a dedicated slave receiver alongside the PICAXE chip. This allows the NKM2401 to receive and store the data at any time, so that the PICAXE chip can then read the data as and when it is ready to do so. The NKM2401 decoder can be used with all PICAXE chips, even those that do not support the rfin command (as it uses the serin command).

For futher details about how to use the NKM2401 decoder please see the AXE213 datasheet. This datasheet also explains in detail how to use low cost RF modules.

Effect of increased clock speed:

This command only functions at 4MHz. M2 and X2 parts automatically use the internal 4MHz resonator for this command.

18M2 Firmware

Please note the 'rfin' command is only supported for 18M2 firmware D.x (PICAXE chips labelled 18M2+) and is not available for use with 18M2 firmware 2.x (PICAXE chips labelled 18M2).

The PICAXE compiler will syntax check code for an 18M2 as correct when using the 'rfin' command but will generate an error when an attempt is made to download into an 18M2 with firmware 2.x.

Applies To:
14M2, 20M2, 28X2, 40X2
See Also:
Related Create:
Share:
Print:

Receive RF data

Read the data from an RF receiver module connected to input pin C.0

Code Example:
main:	rfin C.0, b0,b1,b2,b3,b4,b5,b6,b7
	debug
	goto main
Copy Code Submit an Example

Submit Your Own Code!

You must be logged in to submit code examples. Login now.