Appendix A. Available UObject Devices

Table of Contents

Servo
UltraSonicSensor
SoundSensor
LightSensor
Switch
Battery
Beeper
Command
Instances
Groups

This appendix exhautively describes the UObjects availables in the Lego Mindstorm NXT URBI server.

Servo

Servo describes a motor. A Servo instance contains the following attributes:

Table A.1. Servo's attributes:

NameDescription
valMotor's position. Read only.
speedMotor's speed, from -100 to 100.
PGainProportional gain for the PID control.
IGainIntegral gain for the PID control.
DGainDerivative gain for the PID control.
PrecisionPrecision requiered for the PID control.
portThe port where the servo is plugged. It can be "A", "B" or "C". You can change the value while the server is running. Beware, if you change the port, that will free the old port (so you will be able to create another device on it) and will busy the new one (so you won't be able to create another device on it).
init(port_)

The UObject constructor.

port_ is a port name. (See previous attribute port).

Example:

wheel = new Servo("A");