Subject:
|
Re: Does any RCX firmware allow a variable to survice shutdown?
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Wed, 29 Jun 2005 15:46:03 GMT
|
Viewed:
|
1134 times
|
| |
| |
In lugnet.robotics, Justin Fisher wrote:
> I program in NQC, using Bricx Command Centre as the dev tools. I currently use
> the Lego firmware 2.0. Is this possible with my current set-up? Is it possible
> with any set-up?
Here's a very simple NQC example using the standard LEGO firmware.
#pragma noinit
int a;
task main()
{
a++;
}
This simple NQC program will increment global variable zero by one each time it
is run. You can turn off the RCX and turn it back on as many times as you want.
The value in global variable zero will be retained.
You can use the Watch window in BricxCC to verify that the value is retained and
incremented each time you run this program. You can use the Direct Control
window to initialize the value of this global variable to whatever you want.
Then turn off the RCX and turn it back on. Run this program. Poll the variable
using the Watch window. It will be incremented by one.
Hope this helps,
John Hansen
|
|
Message is in Reply To:
6 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|