|
Re: Does any RCX firmware allow a variable to survice shutdown?: msg#00086hardware.lego.robotics
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 |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Does any RCX firmware allow a variable to survice shutdown?: 00086, John Hansen |
|---|---|
| Next by Date: | Re: Does any RCX firmware allow a variable to survice shutdown?: 00086, Justin |
| Previous by Thread: | Re: Does any RCX firmware allow a variable to survice shutdown?i: 00086, John Hansen |
| Next by Thread: | What should you do with a stuck motor?: 00086, Jordan Bradford |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |