Name:
infrain2
Syntax:

INFRAIN2

Description:

This command is deprecated, please consider using the irin command instead.

Wait until a new infrared command is received.

This command is used to wait for an infraout signal from a separate PICAXE chip. It can also be used with an infrared signal from the infrared TV style transmitter (i.e. can replace infrain). All processing stops until the new command is received. The value of the command received is placed in the predefined variable 'infra'. This will be a number between 0 and 127. See the infraout command description for more details about the values that will be received from the TVR010 remote control.

On the PICAXE-08M/14M/20M 'infra' is another name for 'b13' - it is the same variable. The infra-red input is fixed to a single input - see the PICAXE pinout diagrams. On M2 parts the compiler outputs an irin command using b13. After using this command you may have to perform a hard reset to download a new program to the microcontroller.

Effect of Increased Clock Speed:

This command will only function at 4MHz. Use a setfreq m4 command before this command if using 8MHz speed.

Applies To:
08M, 08M2, 14M, 14M2, 18M, 18M2, 18X, 20M, 20M2
See Also:
Related Create:
Share:
Print:

Receive an IR remote control button push

Wait for an IR button push then set or clear an output depending on the button pushed

Code Example:
main:	infrain2			; wait for new signal
	if infra = 1 then swon1		; switch on 1
	if infra = 4 then swoff1	; switch off 1
	goto main

swon1:	high 1
	goto main
swoff1:	low 1
	goto main
Copy Code Submit an Example

Submit Your Own Code!

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