Manipulation of Lego Mindstorms RCX device.
Namespace:
AForge.Robotics.LegoAssembly: AForge.Robotics.Lego (in AForge.Robotics.Lego.dll) Version: 2.1.1.0 (2.1.1.0)
Syntax
| C# |
|---|
public class RCXBrick |
Remarks
The class allows to manipulate with Lego Mindstorms RCX device, setting its motors' state, getting information about sensors' values and performing some other manipulations.

Sample usage:
// create an instance of RCX brick RCXBrick rcx = new RCXBrick( ); // connect to the device if ( rcx.Connect( RCXBrick.IRTowerType.USB ) ) { // set forward direction of motor A rcx.SetMotorDirection( RCXBrick.Motor.A, true ); // set power of motor rcx.SetMotorPower( RCXBrick.Motor.A, 1 ); // turm motor on rcx.SetMotorOn( RCXBrick.Motor.A, true ); // ... // turn off motors A, B and C rcx.SetMotorOn( RCXBrick.Motor.ABC, false ); // get first sensor's value short value; if ( rcx.GetSensorValue( RCXBrick.Sensor.First, out value ) ) { // ... } // ... }