ROBOTC.net forums
http://robotc.net/forums/

Cache problem ?
http://robotc.net/forums/viewtopic.php?f=1&t=5177
Page 1 of 2

Author:  arnolddejong [ Tue Nov 27, 2012 8:49 pm ]
Post subject:  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.

Author:  MHTS [ Tue Nov 27, 2012 9:02 pm ]
Post subject:  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.

Author:  arnolddejong [ Tue Nov 27, 2012 9:07 pm ]
Post subject:  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!

Author:  MHTS [ Tue Nov 27, 2012 9:13 pm ]
Post subject:  Re: Cache problem ?

How did you "start" the program?

Author:  arnolddejong [ Tue Nov 27, 2012 9:14 pm ]
Post subject:  Re: Cache problem ?

On my NTX I go to My Files > Software files > name of the file > run

Author:  MHTS [ Tue Nov 27, 2012 9:17 pm ]
Post subject:  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".

Author:  arnolddejong [ Tue Nov 27, 2012 9:26 pm ]
Post subject:  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 353 times

Author:  MHTS [ Tue Nov 27, 2012 9:34 pm ]
Post subject:  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.

Author:  arnolddejong [ Tue Nov 27, 2012 9:36 pm ]
Post subject:  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 344 times

Author:  arnolddejong [ Tue Nov 27, 2012 9:38 pm ]
Post subject:  Re: Cache problem ?

I don't see the text on the LCD display!

Author:  MHTS [ Tue Nov 27, 2012 9:43 pm ]
Post subject:  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.

Author:  arnolddejong [ Tue Nov 27, 2012 9:49 pm ]
Post subject:  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 ! :=(

Author:  MHTS [ Tue Nov 27, 2012 9:53 pm ]
Post subject:  Re: Cache problem ?

What version of RobotC are you using? From you flash video, it looks old.

Author:  MHTS [ Tue Nov 27, 2012 9:55 pm ]
Post subject:  Re: Cache problem ?

Are you sure the download was successful? Are you using a USB cable connecting to the NXT?

Author:  arnolddejong [ Tue Nov 27, 2012 9:59 pm ]
Post subject:  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.

Page 1 of 2 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/