Search code examples
debuggingnxtlego-mindstorms

How can you debug Lego Mindstorms programs?


Is there any way to add any sort of debugging to a Lego Mindstorms program, when using the NXT drag-and-drop environment?

It would be nice to be able to monitor the status of the various sensors, but even knowing what step in the program was running would be nice.


Solution

  • It turns out that this is possible in the NXT environment.

    I found an example that walked thru the following steps:

    • add a loop
    • inside the loop, add a sensor
    • next, add a number to text control
    • add a display control
    • wire up the output of the sensor to the input of the number to text control
    • wire up the output of the number to text control to the display

    Now, when you run it, the display will continually update with the values coming from the sensor.

    So it's not a whole lot better than printf statements, but you know, I got a lot of programming done with that technique :)