{"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":"

\"nxt<\/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

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

What to do!
\n<\/strong><\/span><\/h2>\n
    \n
  1. Delete files that are not required on the NXT Brick.\u00a0 (take backups of files first if you require)<\/span><\/li>\n
  2. Removing system files from the NXT brick won’t hurt! (you can always download the firmware if you need to get them back)<\/li>\n
  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.<\/li>\n
  4. Either use Move or Motor, and reuse it often. Instead of using both. This eats up memory.<\/li>\n
  5. Reuse programs \/ code by creating your own blocks (My Block). This saves a lot of memory.<\/li>\n
  6. Save often. This really helps you when we do some\u00a0weird\u00a0program and the NXT window crashes!<\/li>\n<\/ol>\n

    What to avoid!
    \n<\/span><\/strong><\/h2>\n
      \n
    1. \"sound\"<\/a>Minimize use of Sound blocks <\/span>– This will suffocate the memory! Remember the NXT brick has limited memory!<\/li>\n
    2. \"RecordButton\"<\/a>Avoid using the Record\/Play Blocks and File Access<\/span> – Reduces the speed of execution.<\/li>\n
    3. \"text\"<\/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
    4. \"display\"<\/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
    5. \"myblocks\"<\/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

       <\/p>\n

      Good Luck to you all…
      \nAcademy of Robotics
      \n
      www.AcademyofRobotics.net<\/a>\u00a0@ LEGOengineering<\/p>\n

       <\/p>\n

       <\/p>\n","protected":false},"excerpt":{"rendered":"

      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. 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 […]<\/p>\n","protected":false},"author":19,"featured_media":3975,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,159],"tags":[68,70,271,69,71],"_links":{"self":[{"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/posts\/531"}],"collection":[{"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/comments?post=531"}],"version-history":[{"count":0,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/posts\/531\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/media\/3975"}],"wp:attachment":[{"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/media?parent=531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/categories?post=531"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/tags?post=531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}