Contents

About the Authors

About the Technical Reviewer

Acknowledgments

Introduction

images Chapter 1: Meeting the NXT-G Software

Flavors of NXT-G

The User Interface

Connecting the NXT

USB

Bluetooth

Firmware

Summary

images Chapter 2: Software Design Process

Choosing the Right Problem

Define the Problem

Write Pseudo code

Identify Possible Solutions

Create the Code

Test the Solution

Summary

images Chapter 3: Working with My Blocks

Why use My Blocks?

Starting Off Simple

Editing My Block contents

Using a My Block

My Block Properties

Single Property

Multiple Properties

Sharing Values

Managing and Sharing My Blocks

Broken Blocks

Pack and Go

Summary

images Chapter 4: When Things Go Wrong

Walking the Code

Viewing Values

The NXT View menu

My Block Viewers

Alert My Block

Breaking the code down

Common Mistakes

Rotation Completion

Port Settings

Duration Value

Environment

Summary

images Chapter 5: Moving Data

Data Wires

Variables

How It Works

Managing the Variables

Using the Variable Block

Scope

Constants

Defining a Constant

Custom Constant

Summary

images Chapter 6: Making Smart Decisions

Switch Block

Basics

Advanced Switching

Variables

Nesting

Logic Block

Compare Block

Range Block

Summary

images Chapter 7: Motors and Motion

Wheel Circumference

Programming to Go Straight

Move Block

Motor Block

Reset Motor Block

MyMove Blocks

Turning the Robot

Move Block

Motor Blocks

Calculating Turns

Creating a Custom MyPivot Block

Creating a Custom MyTurn Block

Stall Detection

Summary

images Chapter 8: Light Detection

NXT Light sensor

How It Works

Ambient Light

Reflective Light

Calibration

NXT-G Calibration Block

Local File

Viewing Calibration

Deleting Calibration

Line Following

Simple Condition

Complex Condition

Proportional

Dual Light Sensors

Line Detection

Finding the Line

Reading Colored Lines

Aligning with Lines and Edges

Summary

images Chapter 9: Touching and Bumping

The Touch Sensor

Using the Touch Sensor

When Is Pressed Not Pressed?

Determining When to Turn

Squaring Up

Remote NXT Orange Button

Limit Switch

Touch Sensor As an Indicator of an Object

Summary

images Chapter 10: Seeing with Ultrasonics

How It Works

Making It Work on the Game Field

Finding Nearby Objects

Summary

images Chapter 11: Programming Like a Pro

Data Arrays

State Machines

Master Programs

My Blocks

Simple Sequencer Program

Better Sequencer

Advanced Sequencer

Summary

images Chapter 12: Code Management

Single-Computer Scenario

Multiple-Computer Scenario

Online Repositories

Flash Drives

File Naming

Pack and Go

Code Comments

Summary

images Chapter 13: Programming Pitfalls

Block and Program Defaults

Port Defaults

The Yellow-Orange Error

Bad Data Wires

Use of Stop Block Instead of Stop Motors

Hardware/Software Mismatches

Changing Units of Measure

Forgetting What You Meant

Conclusion

images Chapter 14: Tips and Tricks

Understand Your Program Flow

Manage Your Data Flow

Debugging Tips

Know What You Mean

Listen to Your Robot

Apply Design Patterns

Understand What You Wrote

Know How to Navigate Your Program

Hardware Tips That Help the Software

Manage Lighting Conditions Around the Light Sensor

Avoid Pointing Ultrasonic Sensors at Each Other

Organize Your Wires

Consolidate Logic into My Blocks

Keep Your NXT Firmware Updated

Don’t Reinvent the Wheel

Summary

Index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.114.125