Package lejos.hardware.sensor
Class HiTechnicGyro
- java.lang.Object
-
- lejos.hardware.Device
-
- lejos.hardware.sensor.BaseSensor
-
- lejos.hardware.sensor.AnalogSensor
-
- lejos.hardware.sensor.HiTechnicGyro
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,SensorConstants,SensorMode,SensorModes,SampleProvider
public class HiTechnicGyro extends AnalogSensor implements SensorConstants
HiTechnic NXT Gyro Sensor
The NXT Gyro Sensor contains a single axis gyroscopic sensor that detects rotation.The code for this sensor has not been tested. Please report test results to the leJOS forum.
Supported modes Mode name Description unit(s) Getter Rate The Rate mode measures the angular speed of the sensor over a single axis Degrees/second getRateMode()See Sensor Product page See The leJOS sensor framework See
leJOS conventions for SampleProviders- Author:
- Lawrie Griffiths
-
-
Field Summary
-
Fields inherited from class lejos.hardware.sensor.AnalogSensor
currentType, port
-
Fields inherited from class lejos.hardware.sensor.BaseSensor
currentMode, modes
-
Fields inherited from interface lejos.hardware.sensor.SensorConstants
BLACK, BLANK_INDEX, BLUE, BLUE_INDEX, BROWN, GREEN, GREEN_INDEX, MAX_TYPE, MIN_TYPE, MODE_RAW, NXT_ADC_RES, RED, RED_INDEX, TYPE_ANGLE, TYPE_COLORBLUE, TYPE_COLORFULL, TYPE_COLORGREEN, TYPE_COLORNONE, TYPE_COLORRED, TYPE_CUSTOM, TYPE_HIGHSPEED, TYPE_HIGHSPEED_9V, TYPE_HISPEED, TYPE_LIGHT_ACTIVE, TYPE_LIGHT_INACTIVE, TYPE_LOWSPEED, TYPE_LOWSPEED_9V, TYPE_NO_SENSOR, TYPE_REFLECTION, TYPE_SOUND_DB, TYPE_SOUND_DBA, TYPE_SWITCH, TYPE_TEMPERATURE, WHITE, YELLOW
-
-
Constructor Summary
Constructors Constructor Description HiTechnicGyro(AnalogPort port)Supports the SampleProvider interface.HiTechnicGyro(Port port)Supports the SampleProvider interface.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SensorModegetRateMode()HiTechnic Gyro sensor, Rate mode
The Rate mode measures the angular speed of the sensor over three axesprotected voidinit()-
Methods inherited from class lejos.hardware.sensor.AnalogSensor
normalize, NXTRawIntValue, NXTRawValue, switchType
-
Methods inherited from class lejos.hardware.sensor.BaseSensor
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes
-
Methods inherited from class lejos.hardware.Device
close, releaseOnClose
-
-
-
-
Constructor Detail
-
HiTechnicGyro
public HiTechnicGyro(AnalogPort port)
Supports the SampleProvider interface.
The sensor measures the angular velocity in degrees per second. A positive rate indicates a counterclockwise rotation. A negative rate indicates a clockwise rotation.- Parameters:
port- the Analog port
-
HiTechnicGyro
public HiTechnicGyro(Port port)
Supports the SampleProvider interface.
The sensor measures the angular velocity in degrees per second. A positive rate indicates a counterclockwise rotation. A negative rate indicates a clockwise rotation.- Parameters:
port- the Sensor port
-
-
Method Detail
-
init
protected void init()
-
getRateMode
public SensorMode getRateMode()
HiTechnic Gyro sensor, Rate mode
The Rate mode measures the angular speed of the sensor over three axesSize and content of the sample
The sample contains one element giving the angular speed (in degrees/second) of the sensor over its vertical axis (Z-axis).
-
-