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 / 24239
24238  |  24240
Subject: 
Re: Two Usb towers
Newsgroups: 
lugnet.robotics
Date: 
Wed, 17 Aug 2005 04:47:27 GMT
Original-From: 
dan miller <danbmil99@yahoo.AVOIDSPAMcom>
Viewed: 
4744 times
  
Just as a point of reference --

My latest creation has 7 motors, requiring 3 RCX's.  All the high-level
logic is written in Python and runs on my laptop.  I communicate with the
bricks through a single usb tower, using simple file I/O.  The open call
looks like this:

irHnd = CreateFile("\\\\.\\legotower1", GENERIC_READ|GENERIC_WRITE, 0, None,
OPEN_EXISTING, 0, None)

The RCX's run BrickOS.  I don't use LNP, I rolled my own I/O communication
scheme.  It works fine as long as there is a clear line of sight between
tower & CPU's, and there isn't too much ambient light (stray light causes
spurious bytes, which LNP fixes but I don't).

I'm willing to share my code if anyone is interested - dbm


--- "Steve Lane"@yahoo.com, UNEXPECTED_DATA_AFTER_ADDRESS@.SYNTAX-ERROR.
wrote:

> In lugnet.robotics, Steve Hassenplug wrote:
> 
> > 
> > When you use VB, I assume you have a function something like this to • find & open the
> > port:
> > 
> > --
> > Public Function FindTower()
> >     On Error GoTo FindError
> >     Dim strPort As String
> >     Set Me.LEGOcom = New LEGOVPBrickLib.VPBrick
> >     Me.LEGOcom.FindPort strPort
> >     Me.LEGOcom.Open strPort
> >     Me.LEGOcom.Monitor True
> >     Exit Function
> > FindError:
> >     If Err.Number = -520093436 Then
> >         MsgBox "Tower not found"
> >     Else
> >         MsgBox "Error (" & Err.Number & ") " & Err.Description
> >     End If
> > 
> > End Function
> > --
> 
> I decided not to start work on this problem until my second Usb tower
> arrived.
> It came a few days ago and now I've found the time to work on it, but I've
> hit
> another problem.
> 
> I haven't got any code like that above, because (as I've only just
> realised) I'm
> not using Ghost.dll but Phantom instead, which is the usb version of
> Spirit.ocx.
> It's been that long since I added it to my program that I'd completely
> forgotten
> I'd done it. The reason I did it was because it was so much simpler to use
> Phantom because I already understood Spirit.ocx, rather than learn how to
> use
> Ghost as well.
> 
> So now it turns out I can't use Phantom in my attempts to control two usb
> towers
> as it only supports one. I've just been reading some Ghost documentation
> and it
> seems to work in a completely different way to Spirit.ocx. It doesn't even
> support the functions I need, namely Poll() and Setvar(). It doesn't even
> seem
> to have equivalents and seems ridiculously complicated.
> 
> I've noticed Spirit and Ghost are rarely mentioned here, let alone
> compared. I'm
> beginning to see why, but I like Spirit because of it's simplicity
> (although I
> did have a few problems early on).
> 
> If I can't replicate Spirit's functionality with Ghost than I'll have to
> revert
> to the rechargeable solution, which I'm very close to deciding to do at
> this
> point. If the solution exceeds a certain level of difficulty to solve then
> it
> won't be worth it compared with just changing batteries and I'll take that
> course instead.
> 
> Steve





____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs



Message is in Reply To:
  Re: Two Usb towers
 
(...) I decided not to start work on this problem until my second Usb tower arrived. It came a few days ago and now I've found the time to work on it, but I've hit another problem. I haven't got any code like that above, because (as I've only just (...) (21 years ago, 15-Aug-05, to lugnet.robotics)

10 Messages in This Thread:



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

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