2021 nhk A team

Dependencies:   mbed QEI led beep softPWM Servo_softpwm IR2302 lpf

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 Gyroscope, Accelerometer and Magnetic
00040      *  set height to 0
00041      */
00042     void yawcalibrate();
00043     
00044     void algorithmtrasition();
00045      
00046     void calibrateAll(int time);
00047 
00048     /** return XaxisAcceleration
00049      */
00050     float getXaxisAcceleration();
00051 
00052     /** return YaxisAcceleration
00053      */
00054     float getYaxisAcceleration();
00055 
00056     /** return ZaxisAcceleration
00057      */
00058     float getZaxisAcceleration();
00059 
00060     /** return XaxisAngularVelocity
00061      */
00062     float getXaxisAngularVelocity();
00063 
00064     /** return YaxisAngularVelocity
00065      */
00066     float getYaxisAngularVelocity();
00067 
00068     /** return ZaxisAngularVelocity
00069      */
00070     float getZaxisAngularVelocity();
00071 
00072     /** return XaxisMagnetic
00073      */
00074     float getXaxisMagnetic();
00075 
00076     /** return YaxisMagnetic
00077      */
00078     float getYaxisMagnetic();
00079 
00080     /** return ZaxisMagnetic
00081      */
00082     float getZaxisMagnetic();
00083 
00084     /** return XaxisAngle
00085      */
00086     float getXaxisAngle();
00087 
00088     /** return YaxisAngle
00089      */
00090     float getYaxisAngle();
00091 
00092     /** return ZaxisAngle
00093      */
00094     float getZaxisAngle();
00095 
00096 private:
00097     char *getdata(char registar);
00098 };
00099 
00100 #endif