Tantrum

If the center button on the EV3 brick is pressed, Grunt will throw up his arms, stomp around, and roar in a fit of rage. The Tantrum sequence will be programmed within the true case of the brick button switch. We start with the usual setup code, a Display block and a Brick LED block:

Next, Grunt will throw his arms above his head. Add a medium motor block (On for Degrees, -100 percent power, 350 degrees, port A). A second medium motor block (On for Degrees, -75 percent power, 45 degrees, port D) will open his mouth. A sound block will play a custom sound file and make him emit a mighty roar:

Then, drag out a loop block; set it to ...

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.