To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.spyboticsOpen lugnet.robotics.spybotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Spybotics / 233
232  |  234
Subject: 
Re: FindWorld & ClearWorld Spybot NQC API additions
Newsgroups: 
lugnet.robotics.spybotics, lugnet.robotics.rcx.nqc
Date: 
Tue, 21 Oct 2003 13:25:25 GMT
Viewed: 
12017 times
  
In lugnet.robotics.spybotics, Joseph A. O'Donnell wrote:
This is an area of robotics that particularly interests me. Thank you for
doing all this work!

You are quite welcome.  I hope there are at least a few folks out there who are
finding this useful.  Mostly we should all thank Dave Baum for his efforts to
add Spybot support to NQC and for designing a program that allows for extension
in a very flexible and straight-forward a manner.  None of this would be
possible without his fantastic software.  And BricxCC owes huge amounts of its
capability to the NQC source code as well.  Thank you Dave!

Now...how do I put all together? Do I simply add your programming to the
bottom of spy.nqh or are there particular locations where pieces should
go?

You can put my spy.nqh additions anywhere in the spy.nqh file.  I'm a little
worried, though, about standardization issues and the potential for forking the
spy.nqh NQC API.  I'd like to have some active public discussion about each of
the API elements along with a review of the Spybot SDK looking for errors and
omissions (unfortunately, there are a few places where the PDF documentation
doesn't quite match the header files and/or the VPB.hlp file so some input from
LEGO folks in the know might be useful as well).

Such things as #define constant and function naming consistency (following the
existing NQC pattern, for example) need to be addressed.  I've certainly tried
to be proper with my additions but I'd like to have lots of input from other NQC
developers wrt these matters before the cement hardens, as it were.  Ultimately,
it would be nice to get all this rolled into the official built-in API and
submit useful NQC Guide additions to Dave for inclusion in the official
documentation (which I'll roll into BricxCC, of course).  There are a few other
matters wrt NQC and the Spybot API which I'll leave for another post.

I am
assuming that the programming that starts "#include spy.ngh" is the actual
program to be downloaded to the Spybot.

Yes, but most of the sample programs I have posted here are not terribly useful
programs.  Don't expect them to do anything interesting.  An exception to that
rule might be the spybot-to-manas code I posted the other day.

Last night I sent Joseph Woolley an interesting program written in NQC which had
a Spybot monitoring the VLL event while the main task sent out a sequence of VLL
commands in an infinite loop.  The VLL event handler task was programmed to use
SendVLL to output whatever VLL message it received.  I hooked the Scout VLL
output to the Spybot light sensor via the light pipe that came with the Spybot,
used another light pipe from the Spybot's LED output to the Microscout LED
input, and ran the program.  The Microscout motor would run forward and backward
based on the sequence of SendVLL commands in my main task but I could use the
Mindstorms remote to drive output C on the Scout and override the main task
running on the Spybot as the Scout VLL signal fired the VLL event and that
message was forwarded on to the Microscout.  Pretty cool.

The Spybot's internal motors, you should know, are not controlled directly by
incoming VLL commands.  But you could write code to turn one or both of the
motors on and off based on the value of a VLL command within a VLL event handler
task.

1) When I boot BricxCC (latest editions of nqc and BricxCC) and specify
Spybot (and have the Spybot turned on and attached to the serial cable),
BricxCC returns an error that the Brick is not located. Bypassing this
and then attempting to download a program to the Spybot, the error
comes back...no Brick.
What in the world am I doing wrong?

It sounds as if your serial port is in use already.  If you have other serial
devices attached to other serial ports you might need to manually select the
correct port number on the Find Brick dialog (in addition to selecting the
Spybot brick type).  If your spybot is attached to COM1 then the automatic
setting ought to work.  I have Microsoft Active Sync running on my computer for
my Compaq PDA and it can be configured in a manner which causes it to use COM1
even if the cable you plug in to the computer is USB.  I've turned off its
ability to "allow serial cable or infrared connection to this COM port" and my
COM port access problems went away.  I've also heard reports from at least one
person that BricxCC doesn't work with the serial port on their laptop.  Is is
possible that some other software package has your serial port open already?

2) When I try to compile one of the Spybot programs an error comes back
that it cannot open spy.nqh. I currently have spy.nqh in the same
directory as BricxCC and nqc, but have the Spybot program in another
directory. Do I need to move things?

No, you don't need to move things.  You probably need to set your NQC include
path via the Preferences dialog.  Choose Edit/Preferences and switch to the
Compiler tab.  Then switch to the NQC tab on that page.  Enter a path in the
Include path field.  This can be a semicolon-separated list of paths if you wish
to have more than one include directory.  Once you have set this value you
should have no problems with #include directives with NQC anymore.  With
MindScript (on the LCC tab) you can set an include path as well.  Unfortunately,
the LEGO Mindstorms SDK 2.5 puts spybot include files in a separate directory
from RCX & Scout include files and their compiler does not support multiple
include directories like NQC does so you have to switch your include path back
and forth between the two SDK include directories (or copy the include files to
a single directory somewhere on your computer).

Help would sure be appreciated.

Hopefully this helps.

John Hansen



Message has 1 Reply:
  Re: FindWorld & ClearWorld Spybot NQC API additions
 
Thank you for the quick response. I'll try all your suggestions tonight. ...and a great big SQUEEK! SQUEEK! SQUEEK! Joseph (21 years ago, 21-Oct-03, to lugnet.robotics.spybotics, lugnet.robotics.rcx.nqc)

Message is in Reply To:
  Re: FindWorld & ClearWorld Spybot NQC API additions
 
This is an area of robotics that particularly interests me. Thank you for doing all this work! Now...how do I put all together? Do I simply add your programming to the bottom of spy.nqh or are there particular locations where pieces should go? Would (...) (21 years ago, 21-Oct-03, to lugnet.robotics.spybotics, lugnet.robotics.rcx.nqc)

5 Messages in This Thread:


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

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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