NXT-G Programming Guide

A few people requested that I provide more information about the NXT-G Programming Guide, published by Apress. It's currently got an August 13, 2007 release date but I'm trying hard to get that date pushed up so the book can be released sooner.


Some details:

1. The book covers the NXT-G programming environment that is provided with both the retail and the educational versions of the kit.

2. The book does NOT cover the RoboCenter or the RoboEducator tutorials that are included in the software.

3. All the blocks are covered from all 3 palettes, including small sample programs showing you how to use them.

4. Wiring is covered - I've included an entire chapter devoted to the concept of using these drag-and-drop wires that I'm hoping teachers and coaches will find useful.

5. Creating My Blocks is also covered quickly and with a small sample program.

6. There is an NXT robot included in the Appendix and the directions are in CAD format - my photos were converted by Jonathan Daudelin and I owe him some thanks for doing that for me. This robot can be used to test the programs in the book.

7. The concept of Pseudo Code (well, at least MY concept of it) is introduced and I show how it can be used to develop an outline of a program before you start dropping blocks.

... tons of screenshots of the software are included, too.


Unknown said…

sounds like a mandatory thing to possess.

How do you notate the pseudo-code?
Are you using UML or some other modelling language?

I introduce Pseudo code as a sort-of "conversation" with your robot. Remember, this book is mainly for kids and teachers and readers unfamiliar with programming in general, so I'm writing for that audience.

An example:

Me: Robot, I want you to move forward 30 rotations and stop.

Me: Robot, next, I want you to take a Light reading.

This then is used to help determine which blocks will be used... MOVE, LIGHT SENSOR, STOP, etc...

The examples in the book are more complex, but I hope this gives you the general idea. I also use the pseudo code concept to explain things like looping, Logic, Switch blocks, etc...

Unknown said…
Ah, I see.
Interesting approach.

How are your experiences in regard to the feasibility for large and complex programs? One would imagine that this kind of pseudo code tends to become somewhat hard to follow in these cases - does it?
Well, it was a choice between "conversational"-type pseudo code or something like flow charting. I've never really liked flow charting (personal preference) but I do know it has advantages...

My choice for providing pseudo code in readable English-like-sentences does allow for some complexity. Just try it - take a complex NXT-G program and walk through it, describing what the blocks are telling the robot what to do. Now, just do the reverse, decide what you want your robot to do and put it down in regular language. There may be situations where this isn't easy, but overall I hope teaching those who are unfamiliar with programming using this method will work. We'll see...

Anonymous said…
this looks like a book that might help me. as soon as it comes up for sale i will get a copy. Some of use that are used to building technic but just got on the mindstorms programing kick need help. Some us are old and old dogs can learn new tricks it just takes us longer.
thank you Jim Kelly

Mac Ruiz
Unknown said…

I have done a great deal of embedded systems programming over the last 20 years or so (Embedded Systems Engineer). I have found that finite state machines are absolutely THE best way to conceptualize, design, and implement most software (especially "control" software for robotics). Soon (Xmas 2007), my son and I will be doing the Lego NXT-G thing together; However, as a software engineer, I have always really disliked the G language (I do use LabWindows CVI for instrument control/testing).

So, do you have any ideas of how to design NXT software with state machines BUT implement designs in G? I always use original Harel Statecharts - NOT the UML's version.

I have ordered your book on Amazon in any case (because of its great reviews).

Soon to be "G-ing",
Darell Thayer

I don't really have an answer to your question because I'm not 100% certain if I'm understanding. Why don't you email me directly (email on the blog frontpage) and we can discuss maybe putting a blog post up and start some discussion towards answering your question.


Popular Posts