qnx.sensors.Gyroscope

Gyroscope

Properties | Methods | Events


Packageqnx.sensors
Classpublic final class Gyroscope
InheritanceGyroscope Inheritance flash.events.EventDispatcher

Provides values from the Gyroscope sensor.

Class information:
PlayBook Tablet OS Version: 2.1
Found in:  QNXSensors.ane

See also

GyroscopeEvent



Public Properties

 PropertyDefined By
  isSupported : Boolean
[static] [read-only] Returns true if the Gyroscope is supported on the platform the application is currently running on.
Gyroscope

Public Methods

 MethodDefined By
  
Constructs a Gyroscope object.
Gyroscope
  
Get the default delay of a sensor.
Gyroscope
  
Get the maximum delay of a sensor.
Gyroscope
  
Get the minimum delay of a sensor.
Gyroscope
  
getRangeMax():Number
Get the maximum range of a sensor.
Gyroscope
  
getRangeMin():Number
Get the minimum range of a sensor.
Gyroscope
  
getResolution():Number
Get the resolution of a sensor.
Gyroscope
  
setRequestedUpdateInterval(interval:Number):Boolean
Set a sensor's refresh rate The setRequestedUpdateInterval function sets the rate at which the specified sensor should provide updates.
Gyroscope
  
skipDuplicateEvents(skipEvents:Boolean):Boolean
Specify whether duplicate sensor events should be skipped.
Gyroscope
  
start():Boolean
Starts the Gyroscope sensor.
Gyroscope
  
stop():Boolean
Stops the Gyroscope sensor.
Gyroscope

Events

 Event Summary Defined By
  Dispatched when new data from the Gyroscope is availableGyroscope

Property Detail

isSupported


isSupported:Boolean  [read-only]

Returns true if the Gyroscope is supported on the platform the application is currently running on.


Implementation

public static function get isSupported():Boolean

Constructor Detail

Gyroscope()


public function Gyroscope()

Constructs a Gyroscope object.

Method Detail

getDelayDefault()


public function getDelayDefault():int

Get the default delay of a sensor. The getDelayDefault() function gets the default delay of the sensor that is represented by the specified sensor information.

Returns

int — The sensor's default delay.

getDelayMax()


public function getDelayMax():int

Get the maximum delay of a sensor. The getDelayMax() function gets the maximum delay of the sensor that is represented by the specified sensor information.

Returns

int — The sensor's maximum delay.

getDelayMin()


public function getDelayMin():int

Get the minimum delay of a sensor. The getDelayMin() function gets the minimum delay of the sensor that is represented by the specified sensor information.

Returns

int — The sensor's minimum delay.

getRangeMax()


public function getRangeMax():Number

Get the maximum range of a sensor. The getRangeMax() function gets the maximum range of the sensor that is represented by the specified sensor information.

Returns

Number — The sensor's maximum range. NaN will be returned if the resolution could not be retrieved.

getRangeMin()


public function getRangeMin():Number

Get the minimum range of a sensor. The getRangeMin() function gets the minimum range of the sensor that is represented by the specified sensor information.

Returns

Number — The sensor's minimum range. NaN will be returned if the resolution could not be retrieved.

getResolution()


public function getResolution():Number

Get the resolution of a sensor. The getResolution function gets the resolution of the sensor that is represented by the specified sensor information. The resolution represents the sensitivity of a sensor.

Returns

Number — The sensor's resolution. NaN will be returned if the resolution could not be retrieved.

setRequestedUpdateInterval()


public function setRequestedUpdateInterval(interval:Number):Boolean

Set a sensor's refresh rate The setRequestedUpdateInterval function sets the rate at which the specified sensor should provide updates. The device attempts to achieve the specified rate, but this is not guaranteed; the sensor might provide updates more frequently or less frequently than the specified rate. The rate that you specify here corresponds roughly to the number of sensor events that are delivered to the event queue for your application.

Parameters

interval:Number — The rate to set (in milliseconds).

Returns

Booleantrue upon success.

skipDuplicateEvents()


public function skipDuplicateEvents(skipEvents:Boolean):Boolean

Specify whether duplicate sensor events should be skipped. The skipDuplicateEvents() function enables or disables the skipping of duplicate events that are received from the Gyroscope sensor. Calling this method effects all Gyroscope instances.

Parameters

skipEvents:Boolean — If true the device should attempt to skip duplicate events from the specified sensor, if false the device should not skip duplicate events.

Returns

Boolean — Returns true if the call was successful.

start()


public function start():Boolean

Starts the Gyroscope sensor.

Returns

Boolean — A Boolean value when tru the Gyroscope sensor has started.

Throws

Error — An error is thrown if the Gyroscope cannot be started.

See also

stop()

stop()


public function stop():Boolean

Stops the Gyroscope sensor. When you no longer wish to recieve values from the Gyroscope make sure to stop it.

Returns

Boolean

See also

start()

Event Detail

gyroscopeUpdate


Event Object Type: qnx.events.GyroscopeEvent
GyroscopeEvent.type property = qnx.events.GyroscopeEvent.UPDATE

Dispatched when new data from the Gyroscope is available

Defines the value of the type property of a AccelerometerEvent event object.