Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 2:4c7bc164cc4d, committed 2017-01-28
- Comitter:
- Gaku0606
- Date:
- Sat Jan 28 20:13:43 2017 +0000
- Parent:
- 1:6a4c2f84180b
- Child:
- 3:1dcc2a9ff958
- Commit message:
- doxygen????
Changed in this revision
| mpu9250_i2c.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/mpu9250_i2c.h Sat Jan 28 19:52:32 2017 +0000
+++ b/mpu9250_i2c.h Sat Jan 28 20:13:43 2017 +0000
@@ -2,10 +2,9 @@
#define _MPU9250_I2C_H_
/**
- @file mpu9250.h
- @bref mpu9250を比較的簡単に利用できるようにしたライブラリ
- @note ローパスフィルタまわりの実装がまだです.外部でよろです!
- @author Gaku MATSUMOTO
+* @note mpu9250を比較的簡単に利用できるようにしたライブラリ
+* @note ローパスフィルタまわりの実装がまだです.外部でよろです!
+* @author Gaku MATSUMOTO
*/
@@ -106,12 +105,13 @@
public:
/**
- @bref mpu9250インスタンスを生成する
- @param _i2c メインプログラムで宣言したI2Cインスタンスのアドレス
+ @bref mpu9250インスタンスを生成する
+ @param _i2c メインプログラムで宣言したI2Cインスタンスのアドレス
@param celect AD0ピンがHIGHならAD0_HIGH,LOWならAD0_LOW
- @note 第二引数なしだとAD0_HIGHになります.
+ @note 第二引数なしだとAD0_HIGHになります.
*/
mpu9250(I2C &_i2c, AD0 celect = AD0_HIGH);
+
I2C *_nine;
public:
void writeReg(char addr, char data);
@@ -120,37 +120,38 @@
void readReg(char addr, char start_reg, char* buff, char num);
/**
- @bref 慣性センサと通信ができているか確認する
- @return trueが返ってきたら成功,falseなら...
+ @bref 慣性センサと通信ができているか確認する
+ @note trueが返ってきたら成功,falseなら...
*/
+ bool senserTest();
- bool senserTest();
/**
- @bref 地磁気センサと通信ができているか確認する
- @return trueが返ってきたら成功,falseなら...
+ @bref 地磁気センサと通信ができているか確認する
+ @note trueが返ってきたら成功,falseなら...
*/
bool mag_senserTest();
/**
- @bref 加速度センサのレンジを設定
+ @bref 加速度センサのレンジを設定
@param a_range _2G, _4G, _8G, _16Gの中から選択
- @note 引数無しで±4Gになる
+ @note 引数無しで±4Gになる
*/
void setAcc(ACC_RANGE a_range = _4G);
/**
- @bref 角速度センサのレンジ設定
+ @bref 角速度センサのレンジ設定
@param g_range _250DPS, _500DPS, _1000DPS, _2000DPSの中から選択
- @note 引数無しで±500DPS
+ @note 引数無しで±500DPS
*/
void setGyro(GYRO_RANGE g_range = _500DPS);
/**
- @bref 地磁気センサのデータレート設定
- @param rate _8HZ か _100HZを選択
- @note あえて8Hzにする必要は無いと思います.
+ @bref 地磁気センサのデータレート設定
+ @param rate _8HZ か _100HZを選択
+ @note あえて8Hzにする必要は無いと思います.
*/
void setMag(MAG_RATE rate = _100HZ);
+
void init();
/**
@@ -159,71 +160,75 @@
void frequency(int Hz);
/**
- @bref mpu9250のデジタルローパスフィルタの設定
- @param band NO_USE, _460HZ, _184HZ, _92HZ, _41HZ, _20HZ, _10HZ, _5HZから選択
- @note カットオフ周波数なのかサンプルレートなのかよく分かりません.正直効果が見られません
+ @bref mpu9250のデジタルローパスフィルタの設定
+ @param band NO_USE, _460HZ, _184HZ, _92HZ, _41HZ, _20HZ, _10HZ, _5HZから選択
+ @note カットオフ周波数なのかサンプルレートなのかよく分かりません.正直効果が見られません
*/
void setAccLPF(A_BAND_WIDTH band);
/**
- @bref ゼロ点のずれを補正するオフセット値を設定する
+ @bref ゼロ点のずれを補正するオフセット値を設定する
@param ax,ay,az 加速度のオフセット
@param gx,gy,gz 角速度のオフセット
@param mx,my,mz 地磁気のオフセット
- @note とても重要です.地磁気は定期的にキャリブレーションをしてください.ちなみに,これらの値は測定値より引かれています.
+ @note とても重要です.地磁気は定期的にキャリブレーションをしてください.ちなみに,これらの値は測定値より引かれています.
*/
void setOffset(double ax, double ay, double az,
double gx, double gy, double gz,
double mx, double my, double mz);
+
/**
- @bref 加速度を取得します.
+ @bref 加速度を取得します.
@param ax x軸方向の加速度[G]
@param ay y軸方向の加速度[G]
@param az z軸方向の加速度[G]
- @note 型はfloat でも doubleでも構いません.
+ @note 型はfloat でも doubleでも構いません.
*/
template<typename T>void getAcc(T *ax, T *ay, T *az);
+
/**
- @bref 加速度を取得します.
+ @bref 加速度を取得します.
@param acc 各軸方向の加速度[G],x,y,zの順
- @note 型はfloat でも doubleでも構いません.
+ @note 型はfloat でも doubleでも構いません.
*/
template<typename T>void getAcc(T *acc);
/**
- @bref 角速度を取得します.
+ @bref 角速度を取得します.
@param gx x軸方向の角速度[degree/s]
@param gy y軸方向の角速度[degree/s]
@param gz z軸方向の角速度[degree/s]
- @note 型はfloat でも doubleでも構いません.
+ @note 型はfloat でも doubleでも構いません.
*/
template<typename T>void getGyro(T *gx, T *gy, T *gz);
+
/**
- @bref 角速度を取得します.
- @param gyro 各軸方向の角速度[degree/s], x,y,zの順
- @note 型はfloat でも doubleでも構いません.
+ @bref 角速度を取得します.
+ @param gyro 各軸方向の角速度[degree/s], x,y,zの順
+ @note 型はfloat でも doubleでも構いません.
*/
template<typename T>void getGyro(T *gyro);
/**
- @bref 磁束密度を取得します.
+ @bref 磁束密度を取得します.
@param mx x軸方向の磁束密度[uT]
@param my y軸方向の磁束密度[uT]
@param mz z軸方向の磁束密度[uT]
- @note 型はfloat でも doubleでも構いません.
+ @note 型はfloat でも doubleでも構いません.
*/
template<typename T>void getMag(T *mx, T *my, T *mz);
+
/**
- @bref 磁束密度を取得します.
+ @bref 磁束密度を取得します.
@param mag 各軸方向の磁束密度[uT],x,y,zの順
- @note 型はfloat でも doubleでも構いません.
+ @note 型はfloat でも doubleでも構いません.
*/
template<typename T>void getMag(T *mag);
/**
- @bref 角速度と加速度を同時に取得します.
+ @bref 角速度と加速度を同時に取得します.
@param imu データを入れる配列,角速度[degree/s],加速度[G]の順
- @note 配列数は6以上で
+ @note 配列数は6以上で
*/
template<typename T>void getGyroAcc(T *imu);//gx,gy,gz,ax,ay,az