tricks - NXT-G Tips & Tricks These are a collection of...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
NXT-G Tips & Tricks These are a collection of NXT-G tips & tricks written by Brian Davis. These are not "official" tips, just a collection of his own thoughts and rules when he uses NXT-G V1.1 First Rule of NXT-G: Don't rush the editor. When you are inserting a block between existing blocks, you can click & drag it in to position so the 1x3 "shadow" shows in the right place. .. but don't actually drop it until the editor makes room for it. For reasons unknown, the editor seems to get "lost" most often if you rush it, and assume that it knows where all the drops, clicks, and releases in an editing sequence were. Second Rule of NXT-G (&, really, everything else on a computer): " Save Frequently, Save Often ". Because you never know when something you did might pervert something that was working before, or when the editor might crash. Don't save over working copies with the same name, but save "new versions" of programs (& My Blocks!), so you can always backup a step or three. Third Rule of NXT-G: Use My Blocks. These save huge amounts of memory, promote good coding, make things more readable, etc. About the only bad thing I have to say about My Blocks is you can occasionally (OK, I'm the only one I know who's done this) get them so they seem "broken" in the editor, but the compiler will still produce perfectly good code from them; that looks bad but seem to work fine. As far as learning to program, I'm beginning to think My Blocks promote reusable, self-contained code more than most text-based languages do. 4) Switches look great in "flat" form - now get rid of them. The "tabbed" form is both more useful (you can wire in & out of it in tabbed view, and can have more than two states) & more stable (possibly because it's much closer to how NI does this in LabVIEW, while the "flat" format may be a special adaptation for NXT-G only). 4.1) When wiring within a tabbed Switch structure, the this needs a picture
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
wiring works fine in the "first" tabbed field (the "true" field of a logical Switch, for example), but does funny "straight wires to infinity" things in the other fields. You can wire up things on the sequence beam behind a Switch, and then select the entire thing (wires too) and drag it in to make your life easier. 5) Don't use variables when a wire will do. I know every one of us from text-based languages finds this hard to handle, but NXT-G handles wiring values forward better in some cases than it does actual variables (among the problems: all variables are global, and long variable names aren't visible). 6) When wiring, first give yourself plenty of space in Switches & Loops (the old "crowbar & pin" routine). Do it once, and you don't have to do it again. Then use wires in ways that make sense to you (not just "hook up two points"). Clicking at an intermediate position allows you to "Tack" the wire to that point, and bend it another way along the next segment.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/01/2010 for the course ENG 100 taught by Professor Wang during the Spring '10 term at University of Washington.

Page1 / 26

tricks - NXT-G Tips & Tricks These are a collection of...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online