Setting up the switch
At the heart of the beacon check-step is a switch block. The program reads IR 2 to see whether a beacon is nearby. Then, based on the result, the robot will execute one of two cases.
Drag out an IR sensor block and insert it inside of the loop. Set the sensor block's mode (in the bottom-left corner of the block) to Measure | Beacon. The channel number of the beacon that the program will look for is set to channel 1 by default. There is no need to change this unless you want the program to work on a different channel. Whichever channel you choose, make sure that the channel chosen in the program matches the channel selected on the remote control.
Next, drag out a switch block and place it after the IR sensor block. By default, the switch block will read a touch sensor and determine which case to execute based on that sensor's current state. Change the switch's mode to logic. Now the switch will assign one case a true value and the other a false value, and the input to the switch block will determine which of the cases runs.
We will now connect the sensor block to the switch so that if there is a nearby beacon, the sensor block returns a value of true and the switch executes its top true case. If there is no beacon present, the block will return a false value and the switch will execute its bottom false case. To do this, simply find the detected output of the sensor block (the last output on the block) and drag a data wire from this output into the input of the logic switch.
When you finish each of these steps, your program should look like this: