original: http://www.pulsar.org/archive/tav/Lego3/Lego.html
archived: http://web.archive.org/web/*/http://www.pulsar.org/archive/tav/Lego3/Lego.html

JLegoObj

a NeatTools interface to the Lego MindStorm

by Tav Hawkins and Rob Salgado (ver. 1.1 99 Dec.) based on earlier work with Hojung Lim

NeatTools and Lego



Required Components

You will need the following files.



using JLegoObj

On the External Module toolbar, the JLegoObj looks like .

Now, let's setup the LegoObj.
First, We have to set the speed and the parity of the COMObj.

Access the PropertyBox by clicking on the lower-right corner of the module.

Change the speed to "2400" and the parity to "odd"



After the changes the COMObj's propertyBox should reflect the above changes.

Now, let's setup the LegoObj.

Next, let's change the sensor's type.

by right clicking on the Lego Object, we can change the sensor types.

The possible sensor types are Raw, Light, Touch, Temperature, and Rotation

The range of values for the sensors are as follows:

Reading the sensor and battery values.

By connecting an integer type object and causing an event. One can read the sensor's value as an output of type integer from the Lego object.
The battery can be read using the same method, the reading is in units of milli-volts.
RCX can be turned off using the RCX Off button.

Note: If deciding to use a timer to ping the sensor ports, please remember that the sample rate is 2400 baud, so it is easy to clog the com port. If this happens, the error output tag should change to light red, and if the users waits a few seconds, the com port will have a chance to clear itself.


There's a lot more that the Lego Mindstorm RCX can do!

Unfortunately, many other features are not yet available in our external module.

For a list of additional functions please see Kekoa's list of Serial OpCodes

For more information, consult Storm Watch , Kekoa's rcx home page and the Offical Lego MindStorm.


Special thanks for Kekoa for his detailed opcodes and references.
return to Tav's work page