2021 nhk A team

Dependencies:   mbed QEI led beep softPWM Servo_softpwm IR2302 lpf

Committer:
THtakahiro702286
Date:
Sun Oct 31 13:45:53 2021 +0000
Revision:
31:ce079259f559
Parent:
1:ba598e6ff285
10/31 last parameter

Who changed what in which revision?

UserRevisionLine numberNew contents of line
THtakahiro702286 1:ba598e6ff285 1 #ifndef MBED_JY901_H
THtakahiro702286 1:ba598e6ff285 2 #define MBED_JY901_H
THtakahiro702286 1:ba598e6ff285 3
THtakahiro702286 1:ba598e6ff285 4 #include "mbed.h"
THtakahiro702286 1:ba598e6ff285 5 #include "jy901_def.h"
THtakahiro702286 1:ba598e6ff285 6
THtakahiro702286 1:ba598e6ff285 7 /** jy901 class.
THtakahiro702286 1:ba598e6ff285 8 * Can measure acceleration, angular Velocity, magnetic and Angle.
THtakahiro702286 1:ba598e6ff285 9 *
THtakahiro702286 1:ba598e6ff285 10 */
THtakahiro702286 1:ba598e6ff285 11
THtakahiro702286 1:ba598e6ff285 12
THtakahiro702286 1:ba598e6ff285 13 class JY901 : public I2C
THtakahiro702286 1:ba598e6ff285 14 {
THtakahiro702286 1:ba598e6ff285 15 public:
THtakahiro702286 1:ba598e6ff285 16
THtakahiro702286 1:ba598e6ff285 17 /**
THtakahiro702286 1:ba598e6ff285 18 * @param sda
THtakahiro702286 1:ba598e6ff285 19 * @param scl
THtakahiro702286 1:ba598e6ff285 20 */
THtakahiro702286 1:ba598e6ff285 21 JY901(PinName sda, PinName scl);
THtakahiro702286 1:ba598e6ff285 22
THtakahiro702286 1:ba598e6ff285 23 /** calibrate Gyroscope and Accelerometer
THtakahiro702286 1:ba598e6ff285 24 */
THtakahiro702286 1:ba598e6ff285 25 void calibrateGyroAccel();
THtakahiro702286 1:ba598e6ff285 26
THtakahiro702286 1:ba598e6ff285 27 /** calibrate Magnetic
THtakahiro702286 1:ba598e6ff285 28 */
THtakahiro702286 1:ba598e6ff285 29 void calibrateMagnetic();
THtakahiro702286 1:ba598e6ff285 30
THtakahiro702286 1:ba598e6ff285 31 /** set height to 0
THtakahiro702286 1:ba598e6ff285 32 */
THtakahiro702286 1:ba598e6ff285 33 void calibrateHeight();
THtakahiro702286 1:ba598e6ff285 34
THtakahiro702286 1:ba598e6ff285 35 /** end calibration mode
THtakahiro702286 1:ba598e6ff285 36 */
THtakahiro702286 1:ba598e6ff285 37 void endCalibrate();
THtakahiro702286 1:ba598e6ff285 38
THtakahiro702286 1:ba598e6ff285 39 /** calibrate Gyroscope, Accelerometer and Magnetic
THtakahiro702286 1:ba598e6ff285 40 * set height to 0
THtakahiro702286 1:ba598e6ff285 41 */
THtakahiro702286 1:ba598e6ff285 42 void yawcalibrate();
THtakahiro702286 1:ba598e6ff285 43
THtakahiro702286 1:ba598e6ff285 44 void algorithmtrasition();
THtakahiro702286 1:ba598e6ff285 45
THtakahiro702286 1:ba598e6ff285 46 void calibrateAll(int time);
THtakahiro702286 1:ba598e6ff285 47
THtakahiro702286 1:ba598e6ff285 48 /** return XaxisAcceleration
THtakahiro702286 1:ba598e6ff285 49 */
THtakahiro702286 1:ba598e6ff285 50 float getXaxisAcceleration();
THtakahiro702286 1:ba598e6ff285 51
THtakahiro702286 1:ba598e6ff285 52 /** return YaxisAcceleration
THtakahiro702286 1:ba598e6ff285 53 */
THtakahiro702286 1:ba598e6ff285 54 float getYaxisAcceleration();
THtakahiro702286 1:ba598e6ff285 55
THtakahiro702286 1:ba598e6ff285 56 /** return ZaxisAcceleration
THtakahiro702286 1:ba598e6ff285 57 */
THtakahiro702286 1:ba598e6ff285 58 float getZaxisAcceleration();
THtakahiro702286 1:ba598e6ff285 59
THtakahiro702286 1:ba598e6ff285 60 /** return XaxisAngularVelocity
THtakahiro702286 1:ba598e6ff285 61 */
THtakahiro702286 1:ba598e6ff285 62 float getXaxisAngularVelocity();
THtakahiro702286 1:ba598e6ff285 63
THtakahiro702286 1:ba598e6ff285 64 /** return YaxisAngularVelocity
THtakahiro702286 1:ba598e6ff285 65 */
THtakahiro702286 1:ba598e6ff285 66 float getYaxisAngularVelocity();
THtakahiro702286 1:ba598e6ff285 67
THtakahiro702286 1:ba598e6ff285 68 /** return ZaxisAngularVelocity
THtakahiro702286 1:ba598e6ff285 69 */
THtakahiro702286 1:ba598e6ff285 70 float getZaxisAngularVelocity();
THtakahiro702286 1:ba598e6ff285 71
THtakahiro702286 1:ba598e6ff285 72 /** return XaxisMagnetic
THtakahiro702286 1:ba598e6ff285 73 */
THtakahiro702286 1:ba598e6ff285 74 float getXaxisMagnetic();
THtakahiro702286 1:ba598e6ff285 75
THtakahiro702286 1:ba598e6ff285 76 /** return YaxisMagnetic
THtakahiro702286 1:ba598e6ff285 77 */
THtakahiro702286 1:ba598e6ff285 78 float getYaxisMagnetic();
THtakahiro702286 1:ba598e6ff285 79
THtakahiro702286 1:ba598e6ff285 80 /** return ZaxisMagnetic
THtakahiro702286 1:ba598e6ff285 81 */
THtakahiro702286 1:ba598e6ff285 82 float getZaxisMagnetic();
THtakahiro702286 1:ba598e6ff285 83
THtakahiro702286 1:ba598e6ff285 84 /** return XaxisAngle
THtakahiro702286 1:ba598e6ff285 85 */
THtakahiro702286 1:ba598e6ff285 86 float getXaxisAngle();
THtakahiro702286 1:ba598e6ff285 87
THtakahiro702286 1:ba598e6ff285 88 /** return YaxisAngle
THtakahiro702286 1:ba598e6ff285 89 */
THtakahiro702286 1:ba598e6ff285 90 float getYaxisAngle();
THtakahiro702286 1:ba598e6ff285 91
THtakahiro702286 1:ba598e6ff285 92 /** return ZaxisAngle
THtakahiro702286 1:ba598e6ff285 93 */
THtakahiro702286 1:ba598e6ff285 94 float getZaxisAngle();
THtakahiro702286 1:ba598e6ff285 95
THtakahiro702286 1:ba598e6ff285 96 private:
THtakahiro702286 1:ba598e6ff285 97 char *getdata(char registar);
THtakahiro702286 1:ba598e6ff285 98 };
THtakahiro702286 1:ba598e6ff285 99
THtakahiro702286 1:ba598e6ff285 100 #endif