Home Page Icon
Home Page
Table of Contents for
About the Author
Close
About the Author
by James Floyd Kelly
Lego Mindstorms NXT-G Programming Guide, Second Edition
Copyright
About the Author
About the Technical Reviewer
Acknowledgments
Introduction
1. Robots and Programs
1.1. What Is a Robot?
1.2. What Is a Program?
1.3. Programs are for Humans Too
1.4. Programs are Merely Instructions
1.5. The Challenge of Programming
1.6. NXT-G
2. Program Structure
2.1. What Do I Mean by Structure?
2.2. Planning Your Program's Structure
2.3. Moving Into Real Code
2.4. Exercises
2.4.1. Exercise 2-1. Move One Object Nearer to Another
2.4.2. Exercise 2-2. Place Objects at Corners
2.5. What's Next?
2.6. Exercise Solutions
2.6.1. Exercise 2-1
2.6.2. Exercise 2-2
3. Hello World!
3.1. Programming the DISPLAY Block
3.2. Waiting for the Results
3.3. Doing More with DISPLAY
3.4. Understanding Data Hubs
3.5. Exercises
3.5.1. Exercise 3-1. Display Your Own Text
3.5.2. Exercise 3-2: Draw a Rectangle
3.6. What's Next
3.7. Exercise Solutions
3.7.1. Exercise 3-1
3.7.2. Exercise 3-2
4. Get Movin'
4.1. The MOVE block
4.2. Moving Forward and Backward
4.3. Stopping
4.4. Steering
4.5. Power Settings
4.6. Duration Settings
4.7. Braking and Coasting
4.8. Exercises
4.8.1. Exercise 4-1. Drive in a Circle
4.8.2. Exercise 4-2: Make an "S"
4.9. What's Next?
4.10. Exercise Solutions
4.10.1. Exercise 4-1
4.10.2. Exercise 4-2
5. Record and Playback
5.1. The RECORD/PLAY Block
5.2. Recording Movement
5.3. Replaying Movement
5.4. Having Fun with Record/Play
5.5. Exercises
5.5.1. Exercise 5-1: Record a Cha-cha-cha Movement
5.5.2. Exercise 5-2: Roll Forwards and Backwards First
5.6. What's Next?
5.7. Possible Solutions to Exercises
5.7.1. Exercise 7
5.7.2. Exercise 8
6. Make Some Noise!
6.1. The SOUND Block
6.1.1. Action Settings
6.1.1.1. Sound File
6.1.1.2. Tone
6.1.2. Note Settings
6.1.3. Control Settings
6.1.4. Function Settings
6.1.5. Volume Settings
6.1.6. Wait Settings
6.2. Custom Sounds
6.3. Exercises
6.3.1. Exercise 6-1
6.3.2. Exercise 6-2
6.4. What's Next?
6.5. Possible Solutions to Exercises
6.5.1. Exercise 6-1
6.5.2. Exercise 6-2
7. Wired!
7.1. The Problem
7.2. A Simple Solution
7.3. The NXT-G Solution
7.4. An Example
7.5. Types of Data
7.6. Variables
7.7. A Real NXT-G Block
7.8. What's Next?
8. True or False?
8.1. One or the Other
8.2. Sensors: Yes or No
8.3. Variables and the Logic Type
8.4. Using Logic to Configure Settings
8.5. Exercise 11
8.6. What's Next?
8.7. Exercise Solution
9. Feedback
9.1. What's Your Condition?
9.2. Configuring the Sensors
9.2.1. NXT Touch Sensor
9.2.2. RIS Touch Sensor
9.2.3. NXT Sound Sensor
9.2.4. NXT Light Sensor
9.2.5. RIS Light Sensor
9.2.6. NXT Ultrasonic Sensor
9.2.7. NXT Rotation Sensor
9.2.8. RIS Rotation Sensor
9.2.9. NXT Color Sensor
9.2.10. RIS Temperature Sensor
9.3. Other Input Types
9.4. Data Hub Power
9.5. Exercise 9-1
9.6. What's Next?
9.7. Exercise Solution
10. Wait for It!
10.1. The WAIT Block
10.1.1. The LIGHT SENSOR WAIT Block
10.1.2. The NXT BUTTONS WAIT Block
10.1.3. The ROTATION SENSOR WAIT Block
10.1.4. The SOUND SENSOR WAIT Block
10.1.5. The TIMER WAIT Block
10.1.6. The TOUCH SENSOR WAIT Block
10.1.7. The ULTRASONIC SENSOR WAIT Block
10.1.8. The COLOR SENSOR WAIT Block
10.1.9. Exercise 10-1
10.2. What's Next
10.3. Exercise Solution
11. Round and Round
11.1. Do It Again and Again and Again ...
11.2. Nested Loops
11.3. Exercise 11-1
11.4. What's Next?
11.5. Exercise Solution
12. Decisions, Decisions
12.1. Left or Right? Door One or Door Two?
12.2. Flat and Tabbed Views
12.3. Choices
12.4. More Than Two Conditions
12.5. Default Decisions
12.6. Execution!
12.7. Exercise 12-1 Left or Right?
12.8. What's Next?
12.9. Exercise Solution
13. Stop It!
13.1. The STOP Block
13.2. A Looping Example
13.3. An Unconditional STOP
13.4. A SWITCH to a STOP
13.5. STOP for Testing
13.6. What's Next?
14. Pick a Card, Any Card
14.1. The RANDOM Block
14.2. The NUMBER TO TEXT Block
14.3. Exercise 14-1
14.4. What's Next?
14.5. Exercise Solution
15. Apples and Oranges
15.1. Logic
15.2. A Random Example
15.3. The COMPARE Block
15.4. The Display of Logic Values
15.5. A Test Run
15.6. Exercise 15-1 Happy or Sad
15.7. What's Next?
15.8. Exercise Solution
16. Inside or Out?
16.1. The RANGE Block
16.2. Exercise 16-1 Outside a Range
16.3. What's Next?
16.4. Exercise Solution
17. Yes? No? Maybe?
17.1. The LOGIC Block
17.2. Exercise 17-1: SPOT Finds a Spot
17.3. What's Next?
17.4. Exercise Solution
18. Title = Anything You Like
18.1. The VARIABLE Block
18.1.1. Exploring the VARIABLE Block
18.1.2. Reading from a VARIABLE
18.1.3. Writing to a VARIABLE
18.1.4. Storing Many Values
18.1.5. Solving the Example Problem
18.2. The CONSTANT Block
18.3. VARIABLE vs. CONSTANT
18.4. What's Next?
19. Basic Text
19.1. The TEXT Block
19.2. Exercise 19-1: Counting Characters
19.3. What's Next?
19.4. Exercise Solution
20. Basic Math
20.1. The MATH Block
20.2. Exercise 20-1: Calculate Total Degrees Traveled
20.3. What's Next?
20.4. Exercise Solution
21. Staying Alive
21.1. The KEEP ALIVE Block
21.2. Exercise 21-1: Loop Forever or Sleep?
21.3. What's Next?
21.4. Exercise Solution
22. Your Own Filing Cabinet
22.1. Introducing the FILE ACCESS Block
22.2. Exercise 22-1: Left, Right, Left
22.3. What's Next?
22.4. Exercise Solution
23. Calibration
23.1. The CALIBRATE Block
23.2. Put the CALIBRATE Block to Work
23.3. The Calibrate Sensors Tool
23.4. What's Next?
24. Motoring
24.1. The MOTOR Block
24.2. The RESET MOTOR Block
24.3. Exercise 24-1: True Readings
24.4. What's Next?
24.5. Exercise Solution
25. Messages
25.1. The BLUETOOTH CONNECTION Block
25.1.1. Some Preliminaries
25.1.2. Configuring a Connection
25.1.3. Initiating a Connection
25.1.4. Closing a Connection
25.2. The SEND MESSAGE Block
25.3. What's Next?
26. My Block Is Your Block
26.1. Creating a My Block
26.2. Exercise 26-1: The MyBlock Plug
26.3. You're Ready to Go!
26.4. Exercise Solution
A. Math Basics for NXT
A.1. Converting Between Degrees and Rotations
A.2. Converting Degrees and Rotations into Distances
A.3. The X/Y Coordinate System in NXT
B. SPOT Building Instructions
C. Image Editor
C.1. Opening an Image
C.2. Modifying an Image
C.3. Saving an Image
C.4. Using Your Image
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Copyright
Next
Next Chapter
About the Technical Reviewer
About the Author
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset