conclusion

Creating your own blocks is a simple yet powerful way to reuse code, making your programs easier to understand and less prone to error. The three My Blocks presented in this chapter show how to create My Blocks with varying degrees of complexity. Simple blocks such as the Chime block allow you to easily reuse code and help keep programs to a manageable size. Complex blocks with many configuration options such as the DisplayNumber block can help reduce the problems associated with rewriting the same complicated code several times.

Get The Art of LEGO MINDSTORMS NXT-G Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.