Subject:
|
Re: How to send commands directly to the RCX?
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Tue, 8 Feb 2005 05:53:18 GMT
|
Original-From:
|
dan miller <danbmil99@yahoo.^avoidspam^com>
|
Viewed:
|
1842 times
|
| |
| |
You have to open a port to the Lego Tower. Generally it looks like a file. Here's some Python
code I'm using that does it, someone can probably translate to Java:
irHnd = CreateFile("\\\\.\\legotower1", GENERIC_READ|GENERIC_WRITE, 0, None, OPEN_EXISTING, 0,
None)
WriteFile(irHnd, data, None)
CloseHandle(irHnd)
This is a straight translation of the calls of same names in WIN32 API (for instance see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/createfile.asp)
The double slashes resolve to single slashes (like in C), so the device name is really:
"\\.\legotower1" (assuming you only have one, otherwise I suppose it's \\.\legotower2, etc)
On the RCX side, things depend on whether you are using standard firmware (NQC or Lego-generated
bytecode), Lejos, or Legos/Brickos. I'm using Brickos, and I've overridden the serial routines
that are standard (LNP, Lego Networking Protocol). In my app, I've jiggered a tower LED to be 1
centimeter from the RCX in a closed environment, so I don't worry about noise. Under normal
conditions, you need some redundancy, which is provided by LNP (legos), or the standard Lego
message protocol (good description:
http://www.hempeldesigngroup.com/lego/pbForth/scripts/howtoIRData.html)
Anyway, hope this helps, don't be overwhelmed, it's not really that hard. I'm willing to help if
you have more questions.
-dan
--- Matteo Core <wipe_2097@hotmail.com> wrote:
> Sorry i do not mention it but i need it to be done on java if any of you
> have some idea please post it ;
> in any case i want to thank you for replies
>
>
>
|
|
Message is in Reply To:
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|