Setting up the switch

When a button is pressed on the remote control, it sends a command. The infrared sensor attached to the EV3 brick will receive this command and, using this information, the EV3 brick can determine which button or combination of buttons was pressed.

At the heart of the RC program is a switch. The switch uses the IR sensor to read the signals sent by the infrared remote. Then, the switch chooses to execute one of its cases depending on the combination of buttons that was pressed on the remote.

Add a switch block into your program. Make sure that it is placed within the loop. Then, change the mode of the switch to Infrared Sensor | Measure | Remote. This puts the IR sensor into receiver mode. The IR sensor on the Omnilander ...

Get Building Smart LEGO MINDSTORMS EV3 Robots now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.