{"id":531,"date":"2013-09-07T17:48:53","date_gmt":"2013-09-07T07:48:53","guid":{"rendered":"http:\/\/legoeng.local\/?p=531"},"modified":"2013-09-06T18:14:47","modified_gmt":"2013-09-06T08:14:47","slug":"nxt-g-power-programming-tips","status":"publish","type":"post","link":"http:\/\/legoeng.local\/nxt-g-power-programming-tips\/","title":{"rendered":"NXT-G power programming tips"},"content":{"rendered":"
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!<\/p>\n <\/p>\n<\/a>What 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.<\/p>\n
What to do!
\n<\/strong><\/span><\/h2>\n\n
What to avoid!
\n<\/span><\/strong><\/h2>\n\n
<\/a>Minimize use of Sound blocks <\/span>– This will suffocate the memory! Remember the NXT brick has limited memory!<\/li>\n
<\/a>Avoid using the Record\/Play Blocks and File Access<\/span> – Reduces the speed of execution.<\/li>\n
<\/a>Avoid<\/span> using Text Strings to represent numbers. (Use Numeric or Logical Values only) <\/span>– 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.<\/li>\n
<\/a>Avoid using too many pictures\/icons – <\/span><\/span><\/span>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.<\/li>\n
<\/a>Don’t make your program messy… use My Blocks a lot or break down your program to small blocks. – <\/span><\/span><\/span>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!<\/li>\n<\/ol>\n