|-1||use NQC 1.x compatibility mode. The RCX API changed significantly with version 2.0. This flag makes the compiler grok old code.|
|-Ttarget||generate code and use communications methods for "smart bricks" other than the RCX. Currently, can be either CM or Scout.|
|-d||download program to the RCX. When this option is given, code is sent directly over the serial port to the brick and no output file is generated by default.|
|-n||prevent the standard nqc.h file from being automatically included.|
|define macro sym as value.|
|write compiler errors to filename (or to stdout, if no name specified) instead of to stderr.|
|-Ipath||search path for include files. Multiple directories should be seperated as normal for the platform (under Linux / Unix, thatd be ""). Can also be set with the NQC_INCLUDE environment variable.|
|generate a human-readable bytecode listing to filename (or to stdout) instead of generating a binary file.|
|output code to outfile. This option causes a file to be written even if -d or -L is also given. If no filename is specified, the output file will have the same basename as the input file but an extension of .rcx instead of .nqc.|
|use serial port portname. Under Linux, /dev/ttyS0 is the default. (This will differ on other platforms.) The port can also be specified via the RCX_PORT environment variable, but the command line option takes precedence.|
|-Usym||undefine macro sym.|
ACTIONS Actions look similar to options, but they have some subtle differences. In general, options set up things (such as a serial port) for later use, while actions cause something to happen. Actions are executed in the order that they appear on the command line. In addition, actions appearing before the source file happen before compilation, while actions after the source file happen after compilation. For historical reasons, downloading the compiled file (-d) works as an option and not an action.
-run run the current program. This causes the program selected on the RCX to execute. -pgm number select program number. This changes the program slot on the RCX. -datalog get the datalog from the RCX and print it to stdout. -datalog-full same as -datalog but with more verbose output. -near set the IR port to short-range mode. -far set the IR port to long-range mode. -watch time set the RCXs clock to the specified time. If you use now, then the hosts current time is used. -firmware filename downloads the firmware to the RCX. Youll need the official Lego RCX firmware from the CD-ROM -- the current (and so far only) file is called firm0309.lgo. This will probably be necessary the first time you use your RCX, and whenever its been without batteries for more than a few minutes. -firmfast filename same as -firmware, but at quad speed. Requires the tower to be in near mode (see -near). If you have trouble getting the fast download to work, please revert to the older (and slower) method. -sleep timeout set RCX auto-shutoff timeout, in minutes. -msg number send IR message to RCX. The brick will respond to this just as it would a communication from another RCX. -raw data send an arbitrary packet to the RCX and print the reply (if any) to stdout. The data should be a hexadecimal string, with no spaces, zero-padded so that it is an even number of characters (although it may be an odd number of bytes). For example, to read the contents of variable 1, you could use -raw 120001. The bytecodes for raw messages can be found on web sites that document the RCX protocol. -remote value repeat send a repeating remote command to the RCX. -clear erase all programs and datalog from the RCX.
RCX_PORT sets the default serial port. See the -S option. NQC_OPTIONS specifies extra options to be inserted into the command line. For example, setting NQC_OPTIONS to -TScout would cause nqc to target the Scout by default. NQC_INCLUDE specifies additional paths to search for include files. See also the -I option.
To compile foo.nqc, download the bytecode to program slot three, and make the RCX start executing it immediately:
nqc -d -pgm 3 foo.nqc -run
To just compile bar.nqc, resulting in bar.rcx:
To download bar.rcx to the RCX:
nqc -d bar.rcx
To set the IR tower to short-range mode and download the firmware at high speed:
nqc -near -firmfast firm0309.lgo
To compile /usr/doc/nqc-2.1.0/test.nqc and print the resulting bytecode listing to the screen in human-readable format:
nqc -L /usr/doc/nqc-2.1.0/test.nqc
(This should result in the following output under nqc 2.1.0:
*** Task 0 = main000 pwr ABC, 7 13 07 02 07004 dir ABC, Fwd e1 87006 InType 0, Switch 32 00 01009 InMode 0, Boolean 42 00 20012 out A, On 21 81014 chkl 1 != Input(0), 14 95 82 09 01 00 00 fa ff022 plays 0 51 00024 out A, Off 21 41
Older versions of nqc required a seperate rcx.nqh or rcx2.nqh file. This is now integrated into the binary and no longer necessary, but for reference, rcx2.nqh is included with the package. (If you installed the RPM, try /usr/doc/nqc-2.1.0/rcx2.nqh).
http://www.enteract.com/~dbaum/nqc/ The main Not Quite C web site. Youll definitely want to look here. Notably, youll find the NQC Programmers Guide, which covers the NQC language itself. http://www.crynwr.com/lego-robotics/ A great site for alternative RCX / Mindstorms development. http://graphics.stanford.edu/~kekoa/rcx/ Details on the internals of the RCX and the RCX protocol. http://www.lugnet.com/robotics/rcx/nqc/ Discussion group for NQC. Also available via NNTP at lugnet.com. http://nqc.mattdm.org/ Linux binaries and RPM-format packages for NQC, including source RPMs. Also has an RPM containing the NQC language documentation from Daves site, in case youd prefer to have it installed locally.
None known. But be aware that Scout support is still preliminary and may change significantly.
nqc is Copyright (C) 1998-2000 David Baum and released under the terms of the Mozilla Public License. See the documentation included with the program for more details.
The Not Quite C programming language and the nqc program were written and are maintained by Dave Baum. Various contributions have been made by other people -- a full list of these can be found on Daves web site.
This man page was written by Matthew Miller (firstname.lastname@example.org), with extremely large amounts of borrowing from other NQC documentation.
|-->||NQC (1)||Version 2.1 r1: 19 Feb 2000|