To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 68
67  |  69
Subject: 
Does NQC support arrays?
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Tue, 18 May 1999 07:14:03 GMT
Viewed: 
2278 times
  
I'm building a BrickCode Reader.
Basically it reads a stack of 2x2 bricks of various colors like a barcode.
I've managed to hack together a prototype BrickCode Reader.
I can feed it a stack of bricks and it beeps different tones based on which
color brick is passing the light sensor.
It's pretty neat actually.  I plan on using this reader to make various
things such as player piano, or a programmable robot similar to the BarCode
Truck, etc.

Now, my problem is, I need to store these values in an array so I can use it
to control my robot.
Of course I could have performed the actions as I'm reading the BrickCode,
but I thought it would be neater if it scans the bricks, stores the values
in an array, then repeatedly perform the actions coded in the array.

I don't think NQC supports arrays, does it?
I hope I won't have to hardcode a bunch of variables to emulate an array
(yuck!)

Another way I thought of was to use the DataLog, but I could not find a way
to READ the data from NQC.

Any ideas?  Thanks in advance!



Message has 2 Replies:
  Re: Does NQC support arrays?
 
Hari Wiguna <hari@mindvision.com> wrote in message news:FBx2nH.B42@lugnet.com... (...) Nope, it doesn't. This is due to a limitation in the RCX environment. If it did support arrays you could have a max of 32 elements (assuming you didn't have any (...) (26 years ago, 18-May-99, to lugnet.robotics.rcx.nqc)
  Re: Does NQC support arrays?
 
Depending on what the value in the array needs to be you could use a bitmap (e.g. if you want to store true/false to denote the presence of something)... you could then represent the decimal value of the "array" of ones and zeros ... so, for (...) (26 years ago, 18-May-99, to lugnet.robotics.rcx.nqc)

3 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