Winston G. - OwlBot
Programmer - 8th Grade
Subroutines are a collection of programming
commands that are used over and over again within the same program or set of
programs. In the Lego Mindstorm software subroutines are called My Blocks. My
Blocks not only save a lot of time when programming, they can simplify software
design by automatically
performing the mathematical calculations that are necessary to convert
distances on the field of play into rotations on the robots motors. Here is an example of a MyBlock that allows the robot to follow a
line that is printed on the field of play:
This block uses two light sensors
straddling the line. It subtracts one brightness value from the other, divides
it to make less violent changes, and passes it to the steering control of the
move block.
The My Blocks are in blue. They each
represent a frequently used combination of regular programming blocks. Each blue block is really just a shortcut for
ten or more regular blocks. This program
uses a My Block to follow a line until the robot detects a green object near
the line. The program then tells the
robot to turn, pickup the green object, and follow the line back to base.
The idea for using My Blocks and our dual
light sensor line following program came from the book Winning Design! Lego
Mindstorms NXT Design Patterns for Fun and Competition, by James J.
Trobaugh. This book is a must read for serious FLL teams.


Great explanation of programming and the use of My Blocks. It is fascinating to read about the many different things the team is doing together and on their own! Congratulations to both teams for their dedication and efforts!
ReplyDeleteThanks for commenting! If you have any questions feel free to ask me or Mr. O.
ReplyDelete