loading
 
Roborealm crashes upon running Lego NXT module
Zachary Lim from Malaysia  [12 posts]
12 year
I have inserted a sample RR program that I have found to crash once I insert in a Lego NXT module. I have taken part of the example for the Red Object Detection for a test. As you will see in the sample, when you move a red object to the directions up, down, left, right or center, the variable direction changes. As a key, 1 is up, 2 is down, 3 is left, 4 is right and 5 is center.

I am testing to control my robot's movements by moving a red ball. The program is working, but it crashes after I specify the direction variable and click "send".

I have tested the module by itself, not within any program. There is no problem, it works as it should.

Fore reference this is my NXC source code for the receiving end of the program:

//up 1, down 2, left 3, right 4, center 5

task main()
{
int i;

while(true) {
   ReceiveRemoteNumber(0, true, i);
   NumOut(0, LCD_LINE1, i);
  
   switch(i)
   {
   case 1:
   OnFwdReg(OUT_AC, 40, OUT_REGMODE_SPEED);
   break;
  
   case 2:
   OnRevReg(OUT_AC, 40, OUT_REGMODE_SPEED);
   break;
  
   case 3:
   OnFwd(OUT_C, 40);
   Off(OUT_A);
   break;
  
   case 4:
   OnFwd(OUT_A, 40);
   Off(OUT_C);
   break;
  
   case 5:
   Off(OUT_AC);
   }
   }
}

*the mailbox specified 0 is 1 in RR and NXT-G
program.robo
Zachary Lim from Malaysia  [12 posts] 12 year
I will narrow down the problem a bit further. I am assuming seems that the problem is coming from the CScript because when I try to send a variable without the use of  its values being modified by Cscript, it runs perfectly.
Anonymous 12 year
Zack,

We came across a problem related to that module. When causing a syntax error, fixing and reloading would cause the picco C to crash. We've made that fix and uploaded a new version. Can you try that latest out and see if your problem continues.

If so, can you send us the CScript code that you are using in RR?

Thanks,
STeven.
Zachary Lim from Malaysia  [12 posts] 12 year
Apparently, the problem still persists. The program was still running fine up to the moment when i plugged in my NXT via USB and turned it on.\

The source code for the NXC program:
task main()
{
   int i;
  
   while(true) {
       ReceiveRemoteNumber(0, false, i);

       TextOut(0, LCD_LINE1, "direction");
       NumOut(0, LCD_LINE2, i);
       }

}
program.robo

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index