รายละเอียด: LEGO Mindstorms NXT Power Programming
Description
NXT Power Programming delivers everything you need to create the robot you've always dreamed about. This is the definitive guide to C programming by the developer of some of the most powerful and popular development tools for LEGO MINDSTORMS. John C. Hansen presents a comprehensive yet friendly set of tools that allow you to create almost any robot you can imagine.
Inside, you'll find an ingenious set of projects that explore the complete arsenal of NXT functionality. At the heart of these projects is Versa, a versatile mobile robot platform utilizing modular attachments.
Master the Art of:
• NXC, a C language for the NXT
• BricxCC, a full featured programming environment
• Sensors and Motors
• Utilities for Music, Sound Sampling, Graphics and more
• NBC, an Assembler Language for the NXT
• Building Robots without Bricks
• Handheld Arcade Games on the NXT
• An Intruder System using a Sphere Cannon
• NXT to NXT Bluetooth communications
• NXT to Bluetooth devices
• The latest sensors from HiTechnic and mindsensors.com
Table of Contents
Preface vii
Table of Contents ix
Getting Started 1
The Basics 2
Programming Languages 3
Quick Start 6
Starting to Program 12
The NXT Hardware 17
Introducing the Hardware 18
Moving About 24
Sensing Surroundings 27
The NXT Firmware 33
The NXT Menu Interface 34
Introducing the Firmware 37
Building Without Bricks 39
Technic Bricks 40
Units 41
Beams 42
Making the Connection 43
Gears 49
Online Resources 53
Bricx Command Center 55
Connecting to the Brick 56
The Programmer's Editor 64
Drag and Drop Programming 81
Exploring Your Code 83
Managing Macros 84
Compiling and Running 87
Exploring the Tool Windows 89
Getting Help 104
NXT Utilities 107
Creating Melodies 108
Creating Sounds 113
Creating Pictures 116
Decompiling NXT executables 123
Exploring the NXT 124
Virtual NXT 127
Programming the NXT 131
Introduction to C 132
NXC Overview 133
NQC Compatibility 153
RICScript Overview 162
NXT Programs 164
Advanced Programming 167
Introduction to Assembly 168
NBC Overview 170
Building a Basic Robot 201
Building a Basic Mobile Robot 202
Basic NXT Outputs 227
Motors 228
LCD Screen 242
Sounds 250
Basic NXT Inputs 255
Buttons 256
Basic Sensors 258
Advanced NXT Outputs 283
Creating and Writing to Files 284
Sending Messages 291
Custom I[superscript 2]C Output Devices 295
Advanced NXT Inputs 301
Advanced Sensors 302
Opening and Reading Files 308
Receiving Messages 312
Custom Analog Sensors 313
Custom I[superscript 2]C 314
Intruder Alert 323
Building a Bedroom Security System 324
Games People Play 347
Tic-Tac-Toe 348
Nxt-o-sketch 355
Pong 373
Driving Around 381
Direct Commands 382
Remote Control Car 386
NXC Quick Reference 399
NBC Quick Reference 443
NXT Firmware Modules 477
NXT Picture Format 519
Balt castor 529