Using the Infrared Sensor Remote Mode



Infrared Sensor
Remote Infrared Beacon

In Remote mode, the Infrared Sensor can detect which button on the Remote Infrared Beacon (IR Beacon) is pressed. You can also detect when certain combinations of two buttons are pressed at the same time. You can use the Remote mode, for example, to make a remote control for your robot.
The IR Beacon has a Channel Selector that lets you choose one of four different channels for the signals. The Infrared Sensor will only detect signals from the channel you specify.
Tips and Tricks
If two robots are being controlled by two different IR Beacons, they should use different channels. Otherwise, one beacon will control all of the robots on its channel.
Infrared Sensor Remote Mode Data
In Remote mode, the Infrared Sensor gives the following data:
DataTypeRangeNotes
Button ID Numeric0 - 11Identifies which button, or combination of buttons, is pressed on the IR Beacon.

0 = No button (and Beacon Mode is off)
1 = Button 1
2 = Button 2
3 = Button 3
4 = Button 4
5 = Both Button 1 and Button 3
6 = Both Button 1 and Button 4
7 = Both Button 2 and Button 3
8 = Both Button 2 and Button 4
9 = Beacon Mode is on
10 = Both Button 1 and Button 2
11 = Both Button 3 and Button 4

Tips and Tricks
The Beacon Mode button (Button ID = 9) acts differently to the other four buttons. When you press the Beacon Mode button, the beacon starts transmitting continuously until you press the Beacon Mode button again to turn it off. The other four buttons only transmit when they are held down and stop transmitting when you release the button.
Examples using the Infrared Sensor in Remote Mode
Some examples of how you can use the Infrared Sensor in Remote mode are given below.
Example 1: Remote Start Button
This program makes a robot wait until a button on the IR Beacon is pressed (using channel 1), then it drives forward for 2 seconds. It uses the Wait block in the Infrared Sensor – Change – Remote mode. If you start with no button pressed, this will wait until any button on the IR Beacon is pressed.
Example 2: Remote Control Driving
The program below can drive a robot by remote control from the IR Beacon. It uses a Switch in Infrared Sensor – Measure – Remote Buttons mode to choose from four different driving motions depending on which button(s) on the IR Beacon are pressed. You can turn left and right by pressing the top left and top right direction buttons, and go straight by pressing both of these buttons at the same time. The robot is stopped when all buttons are released.

Infrared Sensor Remote Mode Blocks and Modes
The table below shows all of the programming blocks and modes that you can use with the Infrared Sensor in Remote mode.
BlockModeUse
WaitInfrared Sensor – Compare - RemoteWait for a specified button on the IR Beacon to be pressed. You can also wait for one of a set of specified buttons to be pressed.
WaitInfrared Sensor – Change - RemoteWait for any button on the IR Beacon to be pressed, or for the button state to change.
LoopInfrared Sensor – RemoteRepeat a sequence of blocks until a specified button on the IR Beacon is pressed (or until one of a set of specified buttons is pressed).
SwitchInfrared Sensor – Measure – RemoteChoose from two or more sequences of blocks depending on which button(s) are pressed on the IR Beacon.
SwitchInfrared Sensor – Compare - RemoteChoose between two sequences of blocks depending on whether a specified button on the IR Beacon is pressed (or whether one of a set of specified buttons is pressed).
Infrared SensorMeasure - RemoteGet the Button ID of the currently pressed button on the IR Beacon on a Numeric data wire.
Infrared SensorCompare - RemoteTest if a specified button on the IR Beacon is pressed (or one of a set of specified buttons), and get the result on a Logic data wire.
IR Remote Mode
Quick links