ndsmotion.h File Reference

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

Functions

int motion_acceleration_x (void)
 gets acceleration value to mili G (where g is 9.8 m/s*s)
int motion_acceleration_y (void)
 gets acceleration value to mili G (where g is 9.8 m/s*s)
int motion_acceleration_z (void)
 gets acceleration value to mili G (where g is 9.8 m/s*s)
void motion_deinit (void)
 Deinitializes the DS Motion Sensor.
void motion_enable_ain_1 (void)
 This enables the analog input number 1. Required before reading analog input number 1.
void motion_enable_ain_2 (void)
 This enables the analog input number 2. Required before reading analog input number 2.
MotionCalibration * motion_get_calibration (void)
 This returns the current calibration settings for saving.
int motion_init (void)
 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.
int motion_read_ain_1 (void)
 This reads the analog input number 1. analog input number 1 needs to be enabled before reading.
int motion_read_ain_2 (void)
 This reads the analog input number 2. analog input number 2 needs to be enabled before reading.
signed int motion_read_gyro (void)
 read the Z rotational speed
signed int motion_read_x (void)
 read the X acceleration
signed int motion_read_y (void)
 read the Y acceleration
signed int motion_read_z (void)
 read the Z acceleration
int motion_rotation (void)
 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 (void)
 this should be called when the axis is under no rotation Default is 1680
void motion_set_offs_x (void)
 this should be called when the axis is under no acceleration. Default is 2048
void motion_set_offs_y (void)
 this should be called when the axis is under no acceleration Default is 2048
void motion_set_offs_z (void)
 this should be called when the axis is under no acceleration Default is 2048
void motion_set_sens_gyro (int sens)
 this should be passed the raw reading at 1g for accurate acceleration calculations. Default is 825
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

Detailed Description

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


Function Documentation

int motion_init ( void   ) 

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.

Returns:
Examples:
ds_motion/source/main.c.
signed int motion_read_gyro ( void   ) 

read the Z rotational speed

Returns:
Examples:
ds_motion/source/main.c.
signed int motion_read_x ( void   ) 

read the X acceleration

Returns:
Examples:
ds_motion/source/main.c.
signed int motion_read_y ( void   ) 

read the Y acceleration

Returns:
Examples:
ds_motion/source/main.c.
signed int motion_read_z ( void   ) 

read the Z acceleration

Returns:
Examples:
ds_motion/source/main.c.
void motion_set_calibration ( MotionCalibration *  cal  ) 

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

Parameters:
cal the calibration settings
void motion_set_sens_gyro ( int  sens  ) 

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

Parameters:
sens the raw reading at 1g for accurate acceleration calculations
void motion_set_sens_x ( int  sens  ) 

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

Parameters:
sens the raw reading at 1g for accurate acceleration calculations
void motion_set_sens_y ( int  sens  ) 

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

Parameters:
sens the raw reading at 1g for accurate acceleration calculations
void motion_set_sens_z ( int  sens  ) 

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

Parameters:
sens the raw reading at 1g for accurate acceleration calculations
Examples:
ds_motion/source/main.c.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Generated on Sat Oct 2 12:55:13 2010 for libnds by  doxygen 1.6.3