NXT crash in middle of program

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
pepijndevos
Posts: 175
Joined: 28 Dec 2011, 13:07
Location: Gelderland, Netherlands
Contact:

NXT crash in middle of program

Post 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.
-- Pepijn
http://studl.es Mindstorms Building Instructions
spillerrec
Posts: 358
Joined: 01 Oct 2010, 06:37
Location: Denmark
Contact:

Re: NXT crash in middle of program

Post 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.
My blog: http://spillerrec.dk/category/lego/
RICcreator, an alternative to nxtRICeditV2: http://riccreator.sourceforge.net/
jld001
Posts: 19
Joined: 07 Sep 2012, 21:32

Re: NXT crash in middle of program

Post 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
My Githubz of Source Codez, in order of awesomeness:
https://github.com/ArtskydJ/NXC_Source
https://github.com/ArtskydJ/NXC_Tests
My Lego Creations, in no particular order:
LEGO Bop-It - http://www.youtube.com/watch?v=6TsqrBVKbj0
LEGO Safe - http://www.youtube.com/watch?v=MyDRfVquHuY
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests