Published on STEMRobotics (https://stemrobotics.cs.pdx.edu)

Home > Advanced My Blocks

Advanced My Blocks

Submitted by Randy Steele on 11 March, 2012 - 07:45

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

  • Have students resurrect their program for [3]Obstacle Detection Challenge [4]("Obstacle Detection" Lesson)

     

    • This time, have the robot slow down as they approach the obstacle, rather than coming to an abrupt stop
    • Have students use Advanced My Blocks and strive for a program with the fewest blocks possible

       

      • Identify repetitive sections of the program and implement Advanced My Blocks to simplify
      • The most elegant solution will involve nested My Blocks - a My Block placed inside a another My Block
    • The US sensor will be used to adjust the approach speed in an obstacle detection Advanced My Block



National Science Foundation

Source URL:https://stemrobotics.cs.pdx.edu/node/960

Links
[1] https://stemrobotics.cs.pdx.edu/node/743 [2] https://stemrobotics.cs.pdx.edu/node/437 [3] https://stemrobotics.cs.pdx.edu/node/620 [4] https://stemrobotics.cs.pdx.edu/node/632