change code by hasegawa
jy901.h@2:a93909601341, 2017-08-23 (annotated)
- Committer:
- number_key
- Date:
- Wed Aug 23 06:14:28 2017 +0000
- Revision:
- 2:a93909601341
- Parent:
- 1:60d4e2eb6952
- Child:
- 3:ba9da7dbbd9a
add document
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
number_key | 0:f80d034ed481 | 1 | #ifndef MBED_JY901_H |
number_key | 0:f80d034ed481 | 2 | #define MBED_JY901_H |
number_key | 0:f80d034ed481 | 3 | |
number_key | 0:f80d034ed481 | 4 | #include "mbed.h" |
number_key | 0:f80d034ed481 | 5 | #include "jy901_def.h" |
number_key | 0:f80d034ed481 | 6 | |
number_key | 2:a93909601341 | 7 | /** jy901 class. |
number_key | 2:a93909601341 | 8 | * Can measure acceleration, angular Velocity, magnetic and Angle. |
number_key | 2:a93909601341 | 9 | * |
number_key | 2:a93909601341 | 10 | */ |
number_key | 2:a93909601341 | 11 | |
number_key | 0:f80d034ed481 | 12 | |
number_key | 0:f80d034ed481 | 13 | class JY901 : public I2C |
number_key | 0:f80d034ed481 | 14 | { |
number_key | 1:60d4e2eb6952 | 15 | public: |
number_key | 1:60d4e2eb6952 | 16 | |
number_key | 1:60d4e2eb6952 | 17 | /** |
number_key | 1:60d4e2eb6952 | 18 | * @param sda |
number_key | 1:60d4e2eb6952 | 19 | * @param scl |
number_key | 1:60d4e2eb6952 | 20 | */ |
number_key | 0:f80d034ed481 | 21 | JY901(PinName sda, PinName scl); |
number_key | 0:f80d034ed481 | 22 | |
number_key | 1:60d4e2eb6952 | 23 | /** calibrate Gyroscope and Accelerometer |
number_key | 1:60d4e2eb6952 | 24 | */ |
number_key | 0:f80d034ed481 | 25 | void calibrateGyroAccel(); |
number_key | 1:60d4e2eb6952 | 26 | |
number_key | 1:60d4e2eb6952 | 27 | /** calibrate Magnetic |
number_key | 1:60d4e2eb6952 | 28 | */ |
number_key | 0:f80d034ed481 | 29 | void calibrateMagnetic(); |
number_key | 1:60d4e2eb6952 | 30 | |
number_key | 1:60d4e2eb6952 | 31 | /** set height to 0 |
number_key | 1:60d4e2eb6952 | 32 | */ |
number_key | 0:f80d034ed481 | 33 | void calibrateHeight(); |
number_key | 1:60d4e2eb6952 | 34 | |
number_key | 1:60d4e2eb6952 | 35 | /** end calibration mode |
number_key | 1:60d4e2eb6952 | 36 | */ |
number_key | 0:f80d034ed481 | 37 | void endCalibrate(); |
number_key | 1:60d4e2eb6952 | 38 | |
number_key | 1:60d4e2eb6952 | 39 | /** calibrate Gyroscope, Accelerometer and Magnetic |
number_key | 1:60d4e2eb6952 | 40 | * set height to 0 |
number_key | 1:60d4e2eb6952 | 41 | */ |
number_key | 0:f80d034ed481 | 42 | void calibrateAll(int time); |
number_key | 1:60d4e2eb6952 | 43 | |
number_key | 1:60d4e2eb6952 | 44 | /** return XaxisAcceleration |
number_key | 1:60d4e2eb6952 | 45 | */ |
number_key | 0:f80d034ed481 | 46 | float getXaxisAcceleration(); |
number_key | 2:a93909601341 | 47 | |
number_key | 1:60d4e2eb6952 | 48 | /** return YaxisAcceleration |
number_key | 1:60d4e2eb6952 | 49 | */ |
number_key | 0:f80d034ed481 | 50 | float getYaxisAcceleration(); |
number_key | 2:a93909601341 | 51 | |
number_key | 1:60d4e2eb6952 | 52 | /** return ZaxisAcceleration |
number_key | 1:60d4e2eb6952 | 53 | */ |
number_key | 0:f80d034ed481 | 54 | float getZaxisAcceleration(); |
number_key | 2:a93909601341 | 55 | |
number_key | 1:60d4e2eb6952 | 56 | /** return XaxisAngularVelocity |
number_key | 1:60d4e2eb6952 | 57 | */ |
number_key | 0:f80d034ed481 | 58 | float getXaxisAngularVelocity(); |
number_key | 2:a93909601341 | 59 | |
number_key | 1:60d4e2eb6952 | 60 | /** return YaxisAngularVelocity |
number_key | 1:60d4e2eb6952 | 61 | */ |
number_key | 0:f80d034ed481 | 62 | float getYaxisAngularVelocity(); |
number_key | 2:a93909601341 | 63 | |
number_key | 1:60d4e2eb6952 | 64 | /** return ZaxisAngularVelocity |
number_key | 1:60d4e2eb6952 | 65 | */ |
number_key | 0:f80d034ed481 | 66 | float getZaxisAngularVelocity(); |
number_key | 2:a93909601341 | 67 | |
number_key | 1:60d4e2eb6952 | 68 | /** return XaxisMagnetic |
number_key | 1:60d4e2eb6952 | 69 | */ |
number_key | 0:f80d034ed481 | 70 | float getXaxisMagnetic(); |
number_key | 2:a93909601341 | 71 | |
number_key | 1:60d4e2eb6952 | 72 | /** return YaxisMagnetic |
number_key | 1:60d4e2eb6952 | 73 | */ |
number_key | 0:f80d034ed481 | 74 | float getYaxisMagnetic(); |
number_key | 2:a93909601341 | 75 | |
number_key | 1:60d4e2eb6952 | 76 | /** return ZaxisMagnetic |
number_key | 1:60d4e2eb6952 | 77 | */ |
number_key | 0:f80d034ed481 | 78 | float getZaxisMagnetic(); |
number_key | 2:a93909601341 | 79 | |
number_key | 1:60d4e2eb6952 | 80 | /** return XaxisAngle |
number_key | 1:60d4e2eb6952 | 81 | */ |
number_key | 0:f80d034ed481 | 82 | float getXaxisAngle(); |
number_key | 2:a93909601341 | 83 | |
number_key | 1:60d4e2eb6952 | 84 | /** return YaxisAngle |
number_key | 1:60d4e2eb6952 | 85 | */ |
number_key | 0:f80d034ed481 | 86 | float getYaxisAngle(); |
number_key | 2:a93909601341 | 87 | |
number_key | 1:60d4e2eb6952 | 88 | /** return ZaxisAngle |
number_key | 1:60d4e2eb6952 | 89 | */ |
number_key | 0:f80d034ed481 | 90 | float getZaxisAngle(); |
number_key | 1:60d4e2eb6952 | 91 | |
number_key | 2:a93909601341 | 92 | private: |
number_key | 0:f80d034ed481 | 93 | char *getdata(char registar); |
number_key | 2:a93909601341 | 94 | }; |
number_key | 0:f80d034ed481 | 95 | |
number_key | 2:a93909601341 | 96 | #endif |