ジャイロ

Dependents:   00_yotsuba 103_JY901_practice 200_yotsuba_21 200_yotuba_21_uiChange

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers jy901.h Source File

jy901.h

00001 #ifndef MBED_JY901_H
00002 #define MBED_JY901_H
00003 
00004 #include "mbed.h"
00005 #include "jy901_def.h"
00006 
00007 /** jy901 class.
00008  *  Can measure acceleration, angular Velocity, magnetic and Angle.
00009  *
00010  */
00011 
00012 
00013 class JY901 : public I2C
00014 {
00015 public:
00016 
00017     /**
00018      * @param sda
00019      * @param scl
00020      */
00021     JY901 (PinName sda, PinName scl);
00022 
00023     /** calibrate Gyroscope and Accelerometer
00024      */
00025     void calibrateGyroAccel();
00026 
00027     /** calibrate Magnetic
00028      */
00029     void calibrateMagnetic();
00030 
00031     /** set height to 0
00032      */
00033     void calibrateHeight();
00034 
00035     /** end calibration mode
00036      */
00037     void endCalibrate();
00038 
00039     /** calibrate yaw axis
00040      */
00041     void yawcalibrate();
00042     
00043     /** change algorithm
00044      */
00045     void algorithmtrasition();
00046     
00047     /** calibrate Gyroscope, Accelerometer and Magnetic
00048      *  set height to 0
00049      */
00050     void calibrateAll(int time);
00051 
00052     /** return XaxisAcceleration
00053      */
00054     float getXaxisAcceleration();
00055 
00056     /** return YaxisAcceleration
00057      */
00058     float getYaxisAcceleration();
00059 
00060     /** return ZaxisAcceleration
00061      */
00062     float getZaxisAcceleration();
00063 
00064     /** return XaxisAngularVelocity
00065      */
00066     float getXaxisAngularVelocity();
00067 
00068     /** return YaxisAngularVelocity
00069      */
00070     float getYaxisAngularVelocity();
00071 
00072     /** return ZaxisAngularVelocity
00073      */
00074     float getZaxisAngularVelocity();
00075 
00076     /** return XaxisMagnetic
00077      */
00078     float getXaxisMagnetic();
00079 
00080     /** return YaxisMagnetic
00081      */
00082     float getYaxisMagnetic();
00083 
00084     /** return ZaxisMagnetic
00085      */
00086     float getZaxisMagnetic();
00087 
00088     /** return XaxisAngle
00089      */
00090     float getXaxisAngle();
00091 
00092     /** return YaxisAngle
00093      */
00094     float getYaxisAngle();
00095 
00096     /** return ZaxisAngle
00097      */
00098     float getZaxisAngle();
00099 
00100 private:
00101     char *getdata(char registar);
00102 };
00103 
00104 #endif