Subject:
|
Re: Question on Spirit.ocx
|
Newsgroups:
|
lugnet.robotics.rcx
|
Date:
|
Thu, 9 Mar 2000 17:47:20 GMT
|
Viewed:
|
1717 times
|
| |
| |
Hi Andy,
The library Spirit.ocx cannot to this operation.
You can however program it yourself pretty easily.
The following is taken from the lugnet archive:
Subject: Sending a message to a RCX using a PC
From: Denis Cousineau <decousin@indiana.edu>
Newsgroups: lugnet.robotics
Date: Thu, 20 Jan 2000 14:44:38 GMT
Thanks to many people (Roger Hamlett and
Philippe Possemiers among other), I now have a short VB
program that can send message to the RCX using the IR tower.
I give you the code for your use. I always
use mod 256 to make sure the message was in the right range
[0..256]:
You need an object of type MSComm for the communications,
and I assume the value to send is in the object Text1:
with MSComm1
rem setting
.commport=1
.settings="2400,O,8,1"
rem open the serial port
.portopen=true
rem send wrapper
.output=chr$(&H55)
.output=chr$(&HFF)
.output=chr$(&H0)
rem code for message, and inverted code
.output=chr$(&HF7)
.output=chr$(&H08)
rem content of the message, and inverted content
.output=chr$(val(text1) mod 256)
.output=chr$((val(text1) mod 256) XOR &HFF)
rem checksum value, and inverted checksum
.output=chr$((val(text1)+&HF7) mod 256)
.output=chr$(((val(text1)+&HF7) mod 256 ) XOR &HFF)
rem close port
.portopen=false
end with
that's it.
If the object MScomm is not in your toolbar, you can add
it using ctrl-T. It is a standard component of VB 5.00.
Andy Stannard wrote:
>
> Hi,
>
> In the RCX command center there is a dialog that enable you to send a value
> from the PC to the message buffer of the RCX.
>
> How is this implemented using spirit.ocx? I have looked through the SDK and
> can't seem to find anything that enables you to do this.
>
> I am probably just missing something simple but I'm stuck at the moment. Any
> ideas???
>
> Cheers,
>
> Andy.
--
Denis Cousineau, Postdoc *****************************
Cognitive psychology * *
Indiana University * Etudiant devant l'eternel *
Psychology Building * *
Bloomington, 47405 *****************************
Office: (812) 856-5217 Fax: (812) 855-1086
E-mail: decousin@indiana.edu http://Prelude.PSY.UMontreal.CA/~cousined
|
|
Message is in Reply To:
| | Question on Spirit.ocx
|
| Hi, In the RCX command center there is a dialog that enable you to send a value from the PC to the message buffer of the RCX. How is this implemented using spirit.ocx? I have looked through the SDK and can't seem to find anything that enables you to (...) (25 years ago, 8-Mar-00, to lugnet.robotics.rcx)
|
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|