ChucK Class Library Reference

Motion

Motion

MotionMsg

Motion

: Event : Object

Provides data from the various sensors of the host mobile device.

static member variables

int ACCEL

Accelerometer.

int ATTITUDE

Attitude.

int GYRO

Gyroscope.

int HEADING

Compass heading.

int LOCATION

Geographic location.

int MAG

Magnetometer.

int NONE

No sensor type specified.

member functions

void close()

Stop generating input from all sensors.

void close(int type)

Stop generating input from the specified sensor.

int open(int type)

Start generating input from the specified sensor.

int recv(MotionMsg type)

Receive the next sample of sensor data.


MotionMsg

: Object

Holds a single sample of sensor data.

member variables

float heading

Heading of this sample, in degrees clockwise from magnetic north. Valid for compass heading samples only.

float latitude

Latitude of this sample. Valid for location samples only.

float longitude

Longitude of this sample. Valid for location samples only.

time timestamp

Time corresponding to this sample.

int type

Type of the sensor data.

float x

x-coordinate of this sample. Valid for accelerometer, gyroscope, magnetometer, or attitude samples only.

float y

y-coordinate of this sample. Valid for accelerometer, gyroscope, magnetometer, or attitude samples only.

float z

z-coordinate of this sample. Valid for accelerometer, gyroscope, magnetometer, or attitude samples only.