change code by hasegawa
jy901.h@1:60d4e2eb6952, 2017-08-23 (annotated)
- Committer:
- number_key
- Date:
- Wed Aug 23 06:00:02 2017 +0000
- Revision:
- 1:60d4e2eb6952
- Parent:
- 0:f80d034ed481
- Child:
- 2:a93909601341
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 | 0:f80d034ed481 | 7 | |
number_key | 0:f80d034ed481 | 8 | class JY901 : public I2C |
number_key | 0:f80d034ed481 | 9 | { |
number_key | 1:60d4e2eb6952 | 10 | public: |
number_key | 1:60d4e2eb6952 | 11 | |
number_key | 1:60d4e2eb6952 | 12 | /** |
number_key | 1:60d4e2eb6952 | 13 | * @param sda |
number_key | 1:60d4e2eb6952 | 14 | * @param scl |
number_key | 1:60d4e2eb6952 | 15 | */ |
number_key | 0:f80d034ed481 | 16 | JY901(PinName sda, PinName scl); |
number_key | 0:f80d034ed481 | 17 | |
number_key | 1:60d4e2eb6952 | 18 | /** calibrate Gyroscope and Accelerometer |
number_key | 1:60d4e2eb6952 | 19 | */ |
number_key | 0:f80d034ed481 | 20 | void calibrateGyroAccel(); |
number_key | 1:60d4e2eb6952 | 21 | |
number_key | 1:60d4e2eb6952 | 22 | /** calibrate Magnetic |
number_key | 1:60d4e2eb6952 | 23 | */ |
number_key | 0:f80d034ed481 | 24 | void calibrateMagnetic(); |
number_key | 1:60d4e2eb6952 | 25 | |
number_key | 1:60d4e2eb6952 | 26 | /** set height to 0 |
number_key | 1:60d4e2eb6952 | 27 | */ |
number_key | 0:f80d034ed481 | 28 | void calibrateHeight(); |
number_key | 1:60d4e2eb6952 | 29 | |
number_key | 1:60d4e2eb6952 | 30 | /** end calibration mode |
number_key | 1:60d4e2eb6952 | 31 | */ |
number_key | 0:f80d034ed481 | 32 | void endCalibrate(); |
number_key | 1:60d4e2eb6952 | 33 | |
number_key | 1:60d4e2eb6952 | 34 | /** calibrate Gyroscope, Accelerometer and Magnetic |
number_key | 1:60d4e2eb6952 | 35 | * set height to 0 |
number_key | 1:60d4e2eb6952 | 36 | */ |
number_key | 0:f80d034ed481 | 37 | void calibrateAll(int time); |
number_key | 1:60d4e2eb6952 | 38 | |
number_key | 1:60d4e2eb6952 | 39 | /** return XaxisAcceleration |
number_key | 1:60d4e2eb6952 | 40 | */ |
number_key | 0:f80d034ed481 | 41 | float getXaxisAcceleration(); |
number_key | 1:60d4e2eb6952 | 42 | |
number_key | 1:60d4e2eb6952 | 43 | /** return YaxisAcceleration |
number_key | 1:60d4e2eb6952 | 44 | */ |
number_key | 0:f80d034ed481 | 45 | float getYaxisAcceleration(); |
number_key | 1:60d4e2eb6952 | 46 | |
number_key | 1:60d4e2eb6952 | 47 | /** return ZaxisAcceleration |
number_key | 1:60d4e2eb6952 | 48 | */ |
number_key | 0:f80d034ed481 | 49 | float getZaxisAcceleration(); |
number_key | 1:60d4e2eb6952 | 50 | |
number_key | 1:60d4e2eb6952 | 51 | /** return XaxisAngularVelocity |
number_key | 1:60d4e2eb6952 | 52 | */ |
number_key | 0:f80d034ed481 | 53 | float getXaxisAngularVelocity(); |
number_key | 1:60d4e2eb6952 | 54 | |
number_key | 1:60d4e2eb6952 | 55 | /** return YaxisAngularVelocity |
number_key | 1:60d4e2eb6952 | 56 | */ |
number_key | 0:f80d034ed481 | 57 | float getYaxisAngularVelocity(); |
number_key | 1:60d4e2eb6952 | 58 | |
number_key | 1:60d4e2eb6952 | 59 | /** return ZaxisAngularVelocity |
number_key | 1:60d4e2eb6952 | 60 | */ |
number_key | 0:f80d034ed481 | 61 | float getZaxisAngularVelocity(); |
number_key | 1:60d4e2eb6952 | 62 | |
number_key | 1:60d4e2eb6952 | 63 | /** return XaxisMagnetic |
number_key | 1:60d4e2eb6952 | 64 | */ |
number_key | 0:f80d034ed481 | 65 | float getXaxisMagnetic(); |
number_key | 1:60d4e2eb6952 | 66 | |
number_key | 1:60d4e2eb6952 | 67 | /** return YaxisMagnetic |
number_key | 1:60d4e2eb6952 | 68 | */ |
number_key | 0:f80d034ed481 | 69 | float getYaxisMagnetic(); |
number_key | 1:60d4e2eb6952 | 70 | |
number_key | 1:60d4e2eb6952 | 71 | /** return ZaxisMagnetic |
number_key | 1:60d4e2eb6952 | 72 | */ |
number_key | 0:f80d034ed481 | 73 | float getZaxisMagnetic(); |
number_key | 1:60d4e2eb6952 | 74 | |
number_key | 1:60d4e2eb6952 | 75 | /** return XaxisAngle |
number_key | 1:60d4e2eb6952 | 76 | */ |
number_key | 0:f80d034ed481 | 77 | float getXaxisAngle(); |
number_key | 1:60d4e2eb6952 | 78 | |
number_key | 1:60d4e2eb6952 | 79 | /** return YaxisAngle |
number_key | 1:60d4e2eb6952 | 80 | */ |
number_key | 0:f80d034ed481 | 81 | float getYaxisAngle(); |
number_key | 1:60d4e2eb6952 | 82 | |
number_key | 1:60d4e2eb6952 | 83 | /** return ZaxisAngle |
number_key | 1:60d4e2eb6952 | 84 | */ |
number_key | 0:f80d034ed481 | 85 | float getZaxisAngle(); |
number_key | 1:60d4e2eb6952 | 86 | |
number_key | 0:f80d034ed481 | 87 | private: |
number_key | 0:f80d034ed481 | 88 | char *getdata(char registar); |
number_key | 1:60d4e2eb6952 | 89 | }; |
number_key | 0:f80d034ed481 | 90 | |
number_key | 1:60d4e2eb6952 | 91 | #endif |