don't give up

If you already program in traditional languages, it takes some time to get used to programming in NXT-G.

Don't give up - the results are totally worth it!

make myblocks

NXT-G gets slow and starts to, well... screw up, when a program gets too big.

So, if you find yourself duplicating something you've already done, make that a myblock and then use the myblock twice in the program.

This technique rocks for making complex programs.

use the help on the lower right

It's kind of hidden, but it's there. There's a way to get a webpage to pop up for each/every virtual instrument within NXT-G.

embrace parallelism

Nxt-G lets you program any number of concurrently-executing sequence beams (within reason). Use that to awesome ends.

For example - no matter what else is going on, when my rechargable batteries get too low, a low-volume "bonk" every 10 seconds lets me know it's time to plug them in and recharge them. That sequence beam runs totally independent of everything else.

Another example - mixing remote-controlled and autonomous behavior. Bluetooth remote control on one sequence beam, sensor-monitoring which modifies the pertinent variables (motor speed multipliers, for example) in another sequence beam.

With this second example you can do things like have the sonar sensor slow the robot down if it's racing toward a wall. The max reading from that sensor is 72 centimeters, so if you put the value "sensor-reading/72" into a speed-multiplier variable, you can get the robot to slow down and not hit the wall, no matter how fast you're asking it to go via the remote control.

sound is your friend

Easiest way to debug NXT-G programs is to intersperse sound-blocks that make the robot emit beeps, bings, pops, and bonks at certain points. That'll let you know what it's doing in no uncertain terms.

google is your friend too

If you look hard enough you'll find help for NXT-G programming.

For example: http://www.brickshelf.com/cgi-bin/gallery.cgi?f=191310

There are some awesome examples there. What works, what doesn't, and why.

ask questions

Giving up isn't the answer - There are people out there who DO program in NXT-G, so if all else fails, ask questions. The LEGO Education customer support team can be helpful too.

Topic revision: r1 - 2012.01.02 - PaulReiber
 
Copyright © is by author. All material on this collaboration platform is the property of its contributing author.