Tutorial Details:
Difficulty Level:
Basic
Topics Covered: Background
and download information on Mindscript, ScriptED, NQC and
Bricx Command Centre.
Assumed Knowledge:
None
Written By: BILL LANE
BACK
It is possible to create your own programs for controlling
your Spybots. Doing this gives you much greater control and
flexibility than is possible using the visual approach offered
by the Sypbotics software. What this tutorial aims to do is
to look at what languages are commonly used to achieve this
and what you'll need to get going.
There are two programming languages that are commonly used
with Lego Programmable Controllers:
Lego Mindscript:
This is Lego's in-house programming language ( and it's what
you'll find if you take a look inside the mission files ).
To use Mindscript to program your Sypbot you'll need to download
the current version of the Lego Mindstorms SDK. This can be
found at;
http://mindstorms.lego.com/sdk2point5/default.asp
Inside the zip file you'll find an executable. Run this and
follow the steps and it will install all the appropriate pieces.
Amongst other things it will install a script editor called
( appropriately enough ) ScriptED. You can
use this program to connect to the SPC (Spybotics Programmable
Controller), write programs and to download then to your Spybot.
It's fairly straight-forward to use. So have a fiddle and
if you get lost give the help file a look.
NQC ( Not Quite C ) :
This language was developed by Dave Baum for use with Lego
Mindstorms. It is one of the most popular programming languages
for all Lego PCs. It's popularity comes from it's simplicity
and flexibility. It can be downloaded from:
http://www.baumfamily.org/nqc/
Unlike the Mindstorms SDK NQC doesn't come with a script
editor. But you can use it by writing your script in any basic
text editor (e.g Notepad) and then compiling your scripts
using a few DOS commands. You can find more information and
some examples at Dave Baum's website.
Fortunately, for those of us who prefer to avoid the DOS
prompt there is a great editor available in the form of Bricx
Command Centre. Bricx CC provides a typical windows
application interface capable of everything ScriptEd can do
and more. You can download the latest version from:
http://hometown.aol.com/johnbinder/bricxcc.htm
It comes with the NQC compiler as part of the download. But
you might want to double-check that you've got the latest
version of NQC before getting too carried away. Bricx CC is
able to cope with Mindscript (as long as you'll installed
the latest Mindstorms SDK ), amongst others. Just make sure
you don't get your file extensions mixed up or it'll be throwing
up error messages all over the place. Mindscript files have
a .rcx2 file extension and NQC files have a .nqc extension.
If you've got that all straight in your mind then the only
thing between you and your first program is a couple of downloads,
a few installations and the next tutorial:
My First Program ; Mindscript
My First Program ; NQC |