OpenGyro

Initializes the HiTechnic Gyroscopic sensor, sets correct sensor mode

Contents

Syntax

OpenGyro(port)

OpenGyro(port, handle)

Description

OpenGyro(port) initializes the HiTechnic Gyro sensor on the specified sensor port. The value port can be addressed by the symbolic constants SENSOR_1 , SENSOR_2, SENSOR_3 and SENSOR_4 analog to the labeling on the NXT Brick.

Before the sensor can be used, CalibrateGyro has to be called.

With GetGyro(port) you can receive Gyro values up to a max. of +/- 360° rotation rate per sec.

The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call COM_SetDefaultNXT to set one).

Note:

For more details on calibration, see help text and examples of CalibrateGyro.

Examples

   OpenGyro(SENSOR_2);
   CalibrateGyro(SENSOR_2, 'AUTO');
   speed = GetGyro(SENSOR_2);
   CloseSensor(SENSOR_2);

See also

CalibrateGyro, GetGyro, CloseSensor, NXT_SetInputMode, NXT_GetInputValues,

Signature