To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 24143
24142  |  24144
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: 
931 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:
  Does any RCX firmware allow a variable to survice shutdown?
 
I'd like my robot to be able to store a variable, such that when I turn the RCX off, then back on again, with the start/stop button, the value of the variable is retained, not wiped. Is there a third-party firmware or something that allows you to (...) (19 years ago, 28-Jun-05, to lugnet.robotics)

6 Messages in This Thread:




Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR