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 / 12801
12800  |  12802
Subject: 
Re: help with NQC
Newsgroups: 
lugnet.robotics
Date: 
Tue, 17 Oct 2000 18:16:04 GMT
Viewed: 
615 times
  
In lugnet.robotics, "Giacomo" <camp0s@libero.it> writes:
Finally i decided to use NQC, the Lego Programmer was too much limited, and
others system to program the RCX where still limited;in the other hand
,however, i do not want to get under the firmware.
Ok ,i downloaded the firmware 2.0 ,the NQC+Manual v2.2 r1, and after a night
of "passion" i got some question:

1) Where can i find some example of NQC programs ,just to see how they are
written;

2)What are the differences between Functions and Subroutines ? (why trere
are also Functions, subroutins are'nt better, es  less memory use)

3)What are the Assignments ? (+=, -=, /=..)

4)The #include, #define, #if definition, #ifdef symbol, #ifndef
symbol,#else, #elif condition, #endif  : what they do ?

5)Events :how can I use them ? where are they useful than choosing other
system ?


Thanks for the help.


I am a programmer a so I will try to answer some of your questions.

1) I think the NQC distribution has some examples. D. Baum's book : The
Definitive Guide to LEGO Mindstorms" is excellent and has very useful examples.
I may have not gotten the title exactly right

2) Functions are expanded inline (a copy of the code for each instance) and
subroutines are not. Functions can take arguments and subroutines can't. I
don't have my NQC manual so I may have left something out.

3) += is a short hand. for example:

     a += 1;

  is equavalent to:

     a = a + 1

These operator/assignemnts are used when you want to do something to a variable
and put the result back in it.

4) The # things are pre-processor directives. Prior to compilation, the source
is run through a pre-process that does text substitution. This is described in
any C book and in the NQC programmer's guide.



Message is in Reply To:
  help with NQC
 
Finally i decided to use NQC, the Lego Programmer was too much limited, and others system to program the RCX where still limited;in the other hand ,however, i do not want to get under the firmware. Ok ,i downloaded the firmware 2.0 ,the NQC+Manual (...) (24 years ago, 17-Oct-00, to lugnet.robotics)

4 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    
Active threads in Robotics

 
Verified and Trusted Team of Hackers
23 hours ago
Custom Search

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