View unanswered posts | View active topics It is currently Mon Jul 28, 2014 12:16 am






Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Cache problem ? 
Author Message
Rookie

Joined: Tue Nov 27, 2012 8:44 pm
Posts: 9
Post Cache problem ?
Hello,

We've bought a lego mindstorm kit fto use at our school.
Now I'm playing around with the RobotC program to let the robot move.

But if I adjust my code and download it to the NTX again, it will still use the 'old' code which I put there before.

This looks like a cache problem?
Can somebody help me?

Thanks,
Arnold.


Tue Nov 27, 2012 8:49 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Cache problem ?
Tell us what exactly you did so we can figure out what went wrong. If you select Robot->Compile and Download, your new code should be downloaded to the robot. How did you "run" this code? Did you use the joystick dialog? If so, did you click teleop start? NXT allows you to download multiple programs to the brick. If the two programs are with different names, both of them can exist on the brick at the same time. If you are running with the joystick dialog, you need to make sure you have picked the correct teleop program from the dialog.


Tue Nov 27, 2012 9:02 pm
Profile
Rookie

Joined: Tue Nov 27, 2012 8:44 pm
Posts: 9
Post Re: Cache problem ?
Hello,

I'm just using RobotC for prohgramming.

For exaple:
task main()
{
motor[motorB] = 50;
motor[motorC] = 50;
wait1Msec(4000);

motor[motorB] = 50;
motor[motorC] = -50;
wait1Msec(800);

motor[motorB] = 0;
motor[motorC] = 0;
wait1Msec(4000);

motor[motorB] = 50;
motor[motorC] = 50;
wait1Msec(4000);
}

Then using the Robot > Compile and download, the file will be pout on the ntx.

However if I then adjust te code, lets say change the speed to 100, and then Robot > compile and upload, the nTX will still uses the old code!


Tue Nov 27, 2012 9:07 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Cache problem ?
How did you "start" the program?


Tue Nov 27, 2012 9:13 pm
Profile
Rookie

Joined: Tue Nov 27, 2012 8:44 pm
Posts: 9
Post Re: Cache problem ?
On my NTX I go to My Files > Software files > name of the file > run


Tue Nov 27, 2012 9:14 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Cache problem ?
Also pay attention to the tab. When a source file is changed, there is a "*" next to the file name. That means the file has not been "saved" to the disk yet. Usually by clicking "Compile and Download", it will automatically save the file before compiling the code. And make sure you indeed clicked "Compile and Download", not just "Compile".


Tue Nov 27, 2012 9:17 pm
Profile
Rookie

Joined: Tue Nov 27, 2012 8:44 pm
Posts: 9
Post Re: Cache problem ?
I'm sure I've saved the file. Then indeed Robot > compile and download.
But still my NTX will use the old code I've put there before.
I've also tried to delete the file on the NTX, and then compile and download again, buit still the NTX will use the old code.

See the attachment for a short swf movie, how I adjust, save and download the code.


Attachments:
2012-11-28_0220.zip [524.66 KiB]
Downloaded 184 times
Tue Nov 27, 2012 9:26 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Cache problem ?
To make sure it is really running the old file, change the code to this:
Code:
task main()
{
    nxtDisplayTextLine(0, "Test 1");

    motor[motorB] = 50;
    motor[motorC] = 50;
    wait1Msec(4000);

    motor[motorB] = 50;
    motor[motorC] = -50;
    wait1Msec(800);

    motor[motorB] = 0;
    motor[motorC] = 0;
    wait1Msec(4000);

    motor[motorB] = 50;
    motor[motorC] = 50;
    wait1Msec(4000);
}

Every time you change your code, up the test number and see if it is changing on the LCD display.


Tue Nov 27, 2012 9:34 pm
Profile
Rookie

Joined: Tue Nov 27, 2012 8:44 pm
Posts: 9
Post Re: Cache problem ?
What I see when I use the debugger, the yellow debugger line goes from line to line, but after line 15 it will jump to line 19, and not using the lines 17 and 18.

See the attachment for my example swf file.


Attachments:
twee.zip [680.59 KiB]
Downloaded 192 times
Tue Nov 27, 2012 9:36 pm
Profile
Rookie

Joined: Tue Nov 27, 2012 8:44 pm
Posts: 9
Post Re: Cache problem ?
I don't see the text on the LCD display!


Tue Nov 27, 2012 9:38 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Cache problem ?
On the NXT, delete the original file and do a compile and download again and see if that will download the new one.


Tue Nov 27, 2012 9:43 pm
Profile
Rookie

Joined: Tue Nov 27, 2012 8:44 pm
Posts: 9
Post Re: Cache problem ?
Nope, sorry.

When I delete the file, and then turn off the NTX, then wait a while, turn the NTX on, download the new file, then it wil lwork. (sometimes)
because I saw the text appear in the display.
But when I adjust the code and the number for the text, compile and download, it will still show the old text ! :=(


Tue Nov 27, 2012 9:49 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Cache problem ?
What version of RobotC are you using? From you flash video, it looks old.


Tue Nov 27, 2012 9:53 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: Cache problem ?
Are you sure the download was successful? Are you using a USB cable connecting to the NXT?


Tue Nov 27, 2012 9:55 pm
Profile
Rookie

Joined: Tue Nov 27, 2012 8:44 pm
Posts: 9
Post Re: Cache problem ?
ROBOTC 2.01 indeed from dec 8 2009 (sounds old)
This was e version on the CD which was inckluded in the mindstorm package.

I'm using a USB cable to the NTX.


Tue Nov 27, 2012 9:59 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 19 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.