TiltSensor

TiltSensor

new TiltSensor()

Source:

Extends

Members

(readonly) connected

Properties:
Name Type Description
connected boolean

Check if the device is still attached.

Inherited From:
Source:

(readonly) hub

Properties:
Name Type Description
hub Hub

The Hub the device is attached to.

Inherited From:
Source:

(readonly) isVirtualPort

Properties:
Name Type Description
isVirtualPort boolean

Is this device attached to a virtual port (ie. a combined device)

Inherited From:
Source:

(readonly) mode

Properties:
Name Type Description
mode number

The mode the device is currently in

Inherited From:
Source:

(readonly) portName

Properties:
Name Type Description
portName string

The port the device is attached to.

Inherited From:
Source:

(readonly) type

Properties:
Name Type Description
type number

The type of the device

Inherited From:
Source:

Events

accel :object

Emits when tilt sensor detects acceleration. Measured in mG.

Parameters:
Name Type Description
x number
y number
z number
Source:

direction :object

Emits when the tilt sensor direction changes.

Parameters:
Name Type Description
dir TiltDirection
Source:

impactCount :object

Emits when proper acceleration is above threshold (e.g. on impact when being thrown to the ground).

Parameters:
Name Type Description
x number
y number
z number
Source:

tilt :object

Emits when a tilt sensor is activated.

Parameters:
Name Type Description
x number
y number
Source: