Page 1 of 1

NXT crash in middle of program

Posted: 26 Oct 2012, 11:46
by pepijndevos
I built a plotter, and a Python script that generates NXC from an image. The generated NXC looks like this: https://www.refheap.com/paste/6157

It works, but while drawing the 18th line or so, it suddenly shuts down the NXT.

The second time I pressed buttons and kept an eye on the battery, to make sure it doesn't just go to sleep or drain the battery. This is not the case as far as I can tell.

It has been programmed using BricxCC, and the NXT runs version 1.32 of the enhanced firmware.

Is my program too big, or is there a bug in position regulation? I can't think of many other causes.

Re: NXT crash in middle of program

Posted: 02 Nov 2012, 16:11
by spillerrec
While I have no idea, since I never tried anything like this, but you could try to test it. (I have experienced the NXT hanging several times though.)
If you want to test for position regulation, try swapping those functions with dummy functions. Keep passing the same arguments, but let the implementation just be a simple busy loop or something like that.
If you want to test if the function is too large, try storing the commands in a parsable text file and make a simple program which read and executes that.

Btw, you can use SetSleepTime( const byte n ) if you expect the program to run for more than 5 minutes without user-input.

Re: NXT crash in middle of program

Posted: 06 Nov 2012, 19:03
by jld001
I modified your program, but I can't test it. It is now modular-ized. The new format might be easier to debug.
http://pastebin.com/NgEjChFX