NXT-G power programming tips

nxt tipsWhat to do, what not do, and where it pays to be cautious! This posts throws light on some very important aspects of programming robots in NXT-G.

Any program that we write for NXT-G should work without crashing, without lagging, and it should be light on the processor and as well as the memory!

What to do!

  1. Delete files that are not required on the NXT Brick.  (take backups of files first if you require)
  2. Removing system files from the NXT brick won’t hurt! (you can always download the firmware if you need to get them back)
  3. Always give a self explanatory name to the program while working in NXT-G. This name is inherited by default and shows up in the Menu of the NXT Brick.
  4. Either use Move or Motor, and reuse it often. Instead of using both. This eats up memory.
  5. Reuse programs / code by creating your own blocks (My Block). This saves a lot of memory.
  6. Save often. This really helps you when we do some weird program and the NXT window crashes!

What to avoid!

  1. soundMinimize use of Sound blocks – This will suffocate the memory! Remember the NXT brick has limited memory!
  2. RecordButtonAvoid using the Record/Play Blocks and File Access – Reduces the speed of execution.
  3. textAvoid using Text Strings to represent numbers. (Use Numeric or Logical Values only) – Takes extra memory in variable declaration. And it is not a correct practice to store Numeric Variables in Text String format, we might want to use these for calculations later! Text String numbers cannot be used with Math operators.
  4. displayAvoid using too many pictures/icons – Again, just like your Sound, it will fill the space, and decoding the images will also take much time for the small processor to work with.
  5. myblocksDon’t make your program messy… use My Blocks a lot or break down your program to small blocks. – My Blocks will give a clean environment and make debugging much easier. You might need to make others understand what your program is about, Right? Also, this will save a LOT of memory when you reuse a part of the program!

 

Good Luck to you all…
Academy of Robotics
www.AcademyofRobotics.net @ LEGOengineering

 

 

The following two tabs change content below.
Srikanth M
Srikanth M. is the Director of Academy of Robotics, a startup from Visakhapatnam, India. Academy of Robotics has 20 centers across India for students from 4 years to high school, supporting STEM, creative architecture, experiential learning, problem solving, rapid programming, advanced electronics, and embedded systems.
Srikanth M

Latest posts by Srikanth M (see all)