Xem mẫu
iii
The Unofficial Guide to LEGO® MINDSTORMS™ Robots
Jonathan B. Knudsen
O’REILLY
Beijing • Cambridge • Farnham • Köln • Paris • Sebastopol • Taipei • Tokyo
iv
The Unofficial Guide to LEGO® MINDSTORMS™ Robots by Jonathan B. Knudsen
Copyright: © 1999 O`Reilly & Associates, Inc. All rights reserved. Printed in the United States of America.
Published by O`Reilly & Associates, Inc., 101 Morris Street, Sebastopol, CA 95472.
Editor: Mike Loukides
Production Editor: Nicole Arigo
Printing History:
October 1999: First Edition.
This book is published solely by O`Reilly & Associates, Inc., and its purpose is to enable you to creatively program LEGO® MINDSTORMS™ brand robots. This book is not sponsored by The LEGO® Group.
Nutshell Handbook, the Nutshell Handbook logo, and the O`Reilly logo are registered trademarks of O`Reilly & Associates, Inc. The association of the image of a mechanical toy rabbit with the topic of LEGO® MINDSTORMS™ robots is a trademark of O`Reilly & Associates, Inc. LEGO® is a registered trademark of The LEGO® Group. MINDSTORMS™ and Robotics Invention System™ are trademarks of The LEGO® Group. All other trademarks, service marks, and the like are the property of their owners.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O`Reilly & Associates, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher assumes no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.
ISBN: 1-56592-692-7 [12/99] [M]
vii Table of Contents
Preface xi
1. Welcome to MINDSTORMS 1
What Is a Robot? 2
Mobile Robots 2
What Is MINDSTORMS? 6
What Now? 11
Online Resources 11
2. Hank, the Bumper Tank 14
About the Building Instructions 14
Building Instructions 16
A Simple Program 25
Wheels 27
Bumpers and Feelers 31
Gears 31
Multitasking 36
Online Resources 37
3. Trusty, a Line Follower 39
Building Instructions 40
Some Tricky Programming 44
The Light Sensor 48
Idler Wheels 50
Using Two Light Sensors 50
Online Resources 52
4. Not Quite C 53
A Quick Start 54
RCX Software Architecture 55
NQC Overview 58
Trusty Revisited 77
Online Resources 81
viii 5. Minerva, a Robot with an Arm 82
Building Instructions 83
Programming 103
Directional Transmission 107
Pulleys 109 Mechanical Design 110
Two Sensors, One Input 112
Where Am I? 113
Online Resources 115
6. pbFORTH 116
Replacement Firmware 116
pbFORTH Overview 117
About Forth 121
pbFORTH Words 126
An Expensive Thermometer 137
Minerva Revisited 138
Debugging 142
Online Resources 143
7. A Remote Control for Minerva 145
Two Heads Are Better Than One 145
The Allure of Telerobotics 146
Building Instructions 147
Programming the Remote Control 151
Programming Minerva 154
Online Resources 157
8. Using Spirit.ocx with Visual Basic 159
You May Already Have Visual Basic 159
About Spirit.ocx 160
Calling Spirit.ocx Functions 161
Immediate and Delayed Gratification 163
Programs, Tasks, and Subroutines 164
Tips 165
Retrieving the Datalog 168
Online Resources 171
...
- tailieumienphi.vn
nguon tai.lieu . vn