Exploring LEGO® MINDSTORMS® EV3
Total Page:16
File Type:pdf, Size:1020Kb
ffi rs.indd 11:9:3:AM 07/16/2014 Page ii Exploring LEGO® MINDSTORMS® EV3 ffi rs.indd 11:9:3:AM 07/16/2014 Page i ffi rs.indd 11:9:3:AM 07/16/2014 Page ii Exploring LEGO® MINDSTORMS® EV3 Tools and Techniques for Building and Programming Robots Eun Jung (EJ) Park ffi rs.indd 11:9:3:AM 07/16/2014 Page iii Exploring LEGO® MINDSTORMS® EV3: Tools and Techniques for Building and Programming Robots Published by John Wiley & Sons, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright© 2014 by John Wiley & Sons, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN: 978-1-118-87974-0 ISBN: 978-1-118-87972-6 (ebk) ISBN: 978-1-118-87995-5 (ebk) Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or autho- rization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions. Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifi cally disclaim all warranties, including without limitation warranties of fi tness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or website may provide or recommendations it may make. Further, readers should be aware that Internet websites listed in this work may have changed or disap- peared between when this work was written and when it is read. For general information on our other products and services please contact our Customer Care Department within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002. Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http:// booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com. Library of Congress Control Number: 2014937185 Trademarks: Wiley and the Wiley logo are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affi liates, in the United States and other countries, and may not be used without written permission. LEGO and Mindstorms are registered trademarks of LEGO Juris A/S Corporation. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc. is not associated with any product or vendor mentioned in this book. ffi rs.indd 11:9:3:AM 07/16/2014 Page iv (This book is dedicated to my parents.) ffi rs.indd 11:9:3:AM 07/16/2014 Page v ffi rs.indd 11:9:3:AM 07/16/2014 Page vi About the Author Eun Jung (EJ) Park has been developing LEGO robotics and curricula at RoboFun since 2010. There she designs robots that are used in STEM (science, technol- ogy, engineering, and math) programs for children and youths. She hopes that her work provides students with opportunities to develop their creativity and encourages scientifi c curiosity through robotics and coding. Her LEGO robotics projects and building instructions are used in programs for children and youths around New York City. EJ was born in Seoul, South Korea, and studied various art disciplines for more than 12 years, which formed the foundation for her passion in the interac- tive arts. EJ traveled to the United States to earn her Masters degree from the Interactive Telecommunications Program (ITP) at New York University (NYU). In the United States, she enhanced her knowledge of physical computing, pro- gramming, mechanical engineering, and a variety of other technologies. At NYU she started building mechanical moving sculptures called “automatons” and explored various mechanical elements such as gears, cams, and pulleys in her creations. With her work at ITP—and, of course her passion for LEGO—she became the creative force behind Vision Education & Media/RoboFun’s LEGO robotics curricula. At any given moment, she is probably building LEGO robots some- where in New York City. You can see her work at www.ejpark.com. vii ffi rs.indd 11:9:3:AM 07/16/2014 Page vii About the Technical Editor Dr. Damien Kee holds a PhD in robotics and a bachelor’s in electrical engi- neering. He has been running technology-based workshops for students and professional development for teachers since 2003, both in his home country of Australia and abroad. Damien has presented a variety of educational technology topics in places such as QSITE (Australia), Google Apps for Education Summit (Australia), RoboCupJunior (China), Jubilee Centre (Jordan), Tuffs University (USA), RoboFest (Singapore), and ATLAB (United Arab Emirates and Qatar). Since 2001, Damien has been heavily involved with the RoboCup Junior com- petition, at a local, state, national, and international level. From 2009–2011, he was chairman of RoboCup Junior Australia and technical chair of the RoboCup Junior International Rescue Committee. He is the author of several teacher resource books, contributor to theNXTstep.com, and a member of the LEGO MINDSTORMS community program, a group of people around the world who consult with LEGO to make the MINDSTORMS system a better product. ix ffi rs.indd 11:9:3:AM 07/16/2014 Page ix Credits Acquisitions Editor Business Manager Mary James Amy Knies Project Editor Vice President and Executive Jennifer Lynn Group Publisher Richard Swadley Technical Editor Damien Kee Associate Publisher Jim Minatel Production Editor Christine Mugnolo Project Coordinator, Cover Todd Klemme Copy Editor Keith Cline Proofreader Nancy Carrasco Manager of Content Development and Assembly Indexer Mary Beth Wakefi eld John Sleeva Director of Community Marketing Cover Designer David Mayhew Wiley Marketing Manager Cover Image Carrie Sherrill Courtesy of Eun Jung (EJ) Park xi ffi rs.indd 11:9:3:AM 07/16/2014 Page xi ffi rs.indd 11:9:3:AM 07/16/2014 Page xii Acknowledgments From the day I started this book and until this moment, I wouldn’t have been able to survive without support from the following people. My editors from Wiley Publishing, Inc., Mary James and Jennifer Lynn, for encourag- ing me to take on this process and for keeping me on track to meet my deadlines; and also to the technical editor, Damien Kee, for providing valuable advice for the book. Tom Igoe from NYU’s Interactive Telecommunications Program made this book possible by bringing me and Wiley Publishing, Inc. together. The RoboFun Crew, especially the CEO of the company, Laura Allen, for giving me the chance to begin my career in technology curricula development with LEGO robotics in the fi rst place. My appreciations extends, as well, to Lisa Whitmer, as the Program Director at RoboFun, who always encourages me to develop my ideas to their fullest. My friends Brian Cohen and Maria Tranquilli, whose creative spirits and positivity have brought me more confi dence as an artist. My roommates, Aya Takemoto and Christine McCaleb, who would check to make sure that I was okay when I was in my room writing and they hadn’t heard from me for a number of hours. My fi rst supporters and teachers, my parents, Sun Tae Park and Soon Gil Lee, who always give me their support and only wish to make all of my dreams come true; and also my sisters, Ji Hye Park and Hyun Jung Park, who always manage to cheer me up, get me out of ruts, and believe that I can overcome any obstacle. Lucian Reynolds who supported me through every single moment of this process with endless patience, encouragement, advice, and humor; who never stopped trusting in my ability to write this book, even when I doubted myself. To anyone else who wasn’t mentioned already. To all the people who had to get a rain check from me because I was too busy writing this book but who still keep me in their lives. I thank you all. xiii ffi rs.indd 11:9:3:AM 07/16/2014 Page xiii Contents at a Glance Foreword xxiii Introduction xxv Chapter 1 Introducing LEGO MINDSTORMS EV3 1 Chapter 2 Building the Auto-Driver: A Starter Vehicle 13 Chapter 3 Getting Started with Programming 39 Chapter 4 Exploring Action Blocks Part 1: Programming Motors 59 Chapter 5 Exploring Action Blocks Part 2: Using Display, Sound and Brick Status Light Blocks 85 Chapter 6 Exploring Flow Blocks 113 Chapter 7 Building the Spy Rabbit: A Robot That Can React to Its Surroundings 135 Chapter 8 Sensing the Environments: Using the Infrared, Touch, and Color Sensors 161 Chapter 9 Using the Timer and the Rotation Sensor 199 Chapter 10 Building Mr.