nds/arm9/ndsmotion.h File Reference

interface code for the ds motion card, ds motion pak, MK6 More...


Data Structures

struct  MotionCalibration

Functions

int motion_init ()
 Initializes the DS Motion Sensor. Run this before using any of the DS Motion Sensor functions save the return value and pass it to the other motion_ functions.
void motion_deinit ()
 Deinitializes the DS Motion Sensor.
signed int motion_read_x ()
 read the X acceleration
signed int motion_read_y ()
 read the Y acceleration
signed int motion_read_z ()
 read the Z acceleration
signed int motion_read_gyro ()
 read the Z rotational speed
int motion_acceleration_x ()
 gets acceleration value to mili G (where g is 9.8 m/s*s)
int motion_acceleration_y ()
 gets acceleration value to mili G (where g is 9.8 m/s*s)
int motion_acceleration_z ()
 gets acceleration value to mili G (where g is 9.8 m/s*s)
void motion_set_sens_x (int sens)
 this should be passed the raw reading at 1g for accurate acceleration calculations. Default is 819
void motion_set_sens_y (int sens)
 this should be passed the raw reading at 1g for accurate acceleration calculations. Default is 819
void motion_set_sens_z (int sens)
 this should be passed the raw reading at 1g for accurate acceleration calculations. Default is 819
void motion_set_sens_gyro (int sens)
void motion_set_offs_x ()
 this should be called when the axis is under no acceleration default is 2048
void motion_set_offs_y ()
 this should be called when the axis is under no acceleration default is 2048
void motion_set_offs_z ()
 this should be called when the axis is under no acceleration default is 2048
void motion_set_offs_gyro ()
 this should be called when the axis is under no rotation default is 1680
int motion_rotation ()
 converts raw rotation value to degrees per second
MotionCalibrationmotion_get_calibration ()
 This returns the current calibration settings for saving.
void motion_set_calibration (MotionCalibration *cal)
 This sets the calibration settings. Intended to restore saved calibration settings.
void motion_enable_ain_1 ()
 This enables the analog input number 1. Required before reading analog input number 1.
void motion_enable_ain_2 ()
 This enables the analog input number 2. Required before reading analog input number 2.
int motion_read_ain_1 ()
 This reads the analog input number 1. analog input number 1 needs to be enabled before reading.
int motion_read_ain_2 ()
 This reads the analog input number 2. analog input number 2 needs to be enabled before reading.


Detailed Description

interface code for the ds motion card, ds motion pak, MK6


Function Documentation

int motion_acceleration_x (  ) 

gets acceleration value to mili G (where g is 9.8 m/s*s)

int motion_acceleration_y (  ) 

gets acceleration value to mili G (where g is 9.8 m/s*s)

int motion_acceleration_z (  ) 

gets acceleration value to mili G (where g is 9.8 m/s*s)

int motion_deinit (  ) 

Deinitializes the DS Motion Sensor.

MotionCalibration * motion_enable_ain_1 (  ) 

This enables the analog input number 1. Required before reading analog input number 1.

MotionCalibration * motion_enable_ain_2 (  ) 

This enables the analog input number 2. Required before reading analog input number 2.

MotionCalibration * motion_get_calibration (  ) 

This returns the current calibration settings for saving.

int motion_init (  ) 

Initializes the DS Motion Sensor. Run this before using any of the DS Motion Sensor functions save the return value and pass it to the other motion_ functions.

MotionCalibration * motion_read_ain_1 (  ) 

This reads the analog input number 1. analog input number 1 needs to be enabled before reading.

MotionCalibration * motion_read_ain_2 (  ) 

This reads the analog input number 2. analog input number 2 needs to be enabled before reading.

signed int motion_read_gyro (  ) 

read the Z rotational speed

signed int motion_read_x (  ) 

read the X acceleration

signed int motion_read_y (  ) 

read the Y acceleration

signed int motion_read_z (  ) 

read the Z acceleration

int motion_rotation (  ) 

converts raw rotation value to degrees per second

void motion_set_calibration ( MotionCalibration cal  ) 

This sets the calibration settings. Intended to restore saved calibration settings.

void motion_set_offs_gyro (  ) 

this should be called when the axis is under no rotation default is 1680

void motion_set_offs_x (  ) 

this should be called when the axis is under no acceleration default is 2048

void motion_set_offs_y (  ) 

this should be called when the axis is under no acceleration default is 2048

void motion_set_offs_z (  ) 

this should be called when the axis is under no acceleration default is 2048

void motion_set_sens_gyro ( int  sens  ) 

void motion_set_sens_x ( int  sens  ) 

this should be passed the raw reading at 1g for accurate acceleration calculations. Default is 819

this should be passed the raw reading at 1g for accurate acceleration calculations. Default is 825

void motion_set_sens_y ( int  sens  ) 

this should be passed the raw reading at 1g for accurate acceleration calculations. Default is 819

void motion_set_sens_z ( int  sens  ) 

this should be passed the raw reading at 1g for accurate acceleration calculations. Default is 819


Generated on Tue Jan 22 15:48:55 2008 for libnds(ARM9) by  doxygen 1.5.4