Programming the cases

The rest of the programming is straightforward, albeit monotonous. The difficult part of the programming is complete, but we still need to assign and program a case for every possible remote button combination (at least, the combinations we plan to use).

In the first case, no buttons are pressed (button ID 0), so the Falcon should halt and center its steering. Recall that this is the default case, so the Falcon's preferred action is to idle if no remote buttons are pressed. Add the steerReCenter MyBlock and a move steering block (Off, ports B and C):

In the second case (button ID 1), the robot is driving forward in a ...

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.