Instruction Guide: My Blocks

This lesson introduces students to the concept of My Blocks - the NXT-G equivalent of a sub-routine. Have students watch the "My Blocks" video from Dale Yocum's NXT Tutorial series.

  • Have students resurrect their program for Line Counting ("Move Until Dark" Lesson)
    • Identify repetitive sections of their program and implement My Blocks to simplify
    • If students used the light sensor to determine both when they reach a line and then when they leave a line, they will have the most elegant solution.
      • if students used rotations or time to get off the line, then their program will not be as compact - encourage them to make the change now
  • Have students resurrect their program for Sentry Challenge ("Repeating Behaviors" Lesson)
    • Identify repetitive sections of their program and implement My Blocks to simplify
  • Have students resurrect their program for Obstacle Detection Challenge ("Obstacle Detection" Lesson)
    • Identify repetitive sections of their program and implement My Blocks to simplify
    • The most elegant solution will involve nested My Blocks - a My Block placed inside a another My Block
  • Have student resurrect their program for the Fruit Picker Challenge ("Arm Control" Lesson)
    • Identify repetitive sections of their program and implement My Blocks to simplify
  • Have students develop a new challenge that takes advantage of My Blocks to simplify what would otherwise be an unwieldy program