Handshake

If Grunt's IR sensor detects a nearby person, he will greet the person by extending his arm and offering a handshake. He will hold his arm out for three seconds. If the person accepts the offer, the touch sensor in Grunt's hand will detect that the person is squeezing his hand, and he will shake his or her hand. If the three seconds expire and the person has not shaken Grunt's hand, he will put it back down. This is another example of a novel interactive feature that lends Grunt a rich interactive experience.

The first step in programming the handshake sequence is to add the usual initialization code: a display block that prints Handshake to the EV3 screen and a block that changes the brick LEDs to orange. You may also wish to incorporate ...

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.