Chapter    4

When Things Go Wrong

Even the best-thought-out program can have unexpected issues. Some are easy to track down; others can drive you crazy trying to figure out what is going wrong. Again, you might be tempted to blame the robot as being faulty, but 99.99 percent of the time, that is not the case. The robot is doing exactly what it is told to do by your program.

Walking the Code

Sometimes just slowing down and “walking” through your code will help you find the solution. People tend to get upset or anxious about the program not working right, and then they have a hard time focusing. This is a good time to step back from the code and try to look at it from a different perspective—look at it as if you have never seen the code before. ...

Get Winning LEGO MINDSTORMS 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.