the edit-compile-test cycle

The process you just went through is an example of the typical programming process. In fact, it even has a name: the edit-compile-test cycle.

It is very unusual for any program to work the first time. After writing your program, download it to the NXT and test it. Testing will often reveal some problem, so you return to editing. Just keep going through the cycle, adding features and fixing problems. Eventually, all the features are added and all the problems are worked out to give you a complete working program. It can take some patience and perseverance, but it is a great feeling when it finally works.

Note

Why didn’t the first program have the same problem? It’s because the Sound block has a Wait for Completion option ...

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.