9axis-sensor library
Hepta9axis.h@13:e2d6617ed02a, 2022-08-19 (annotated)
- Committer:
- RyusukeIwata
- Date:
- Fri Aug 19 03:00:21 2022 +0000
- Revision:
- 13:e2d6617ed02a
- Parent:
- 12:f52c96610b21
changed ver 2
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hepta2ume | 0:5aaec0996753 | 1 | #ifndef MBED_HEPTA9AXIS_H |
hepta2ume | 0:5aaec0996753 | 2 | #define MBED_HEPTA9AXIS_H |
hepta2ume | 0:5aaec0996753 | 3 | #include "mbed.h" |
hepta2ume | 0:5aaec0996753 | 4 | |
umeume | 2:306058b9d04e | 5 | class Hepta9axis |
hepta2ume | 0:5aaec0996753 | 6 | { |
hepta2ume | 0:5aaec0996753 | 7 | public: |
HEPTA | 3:d5eed0bb962e | 8 | I2C n_axis; |
RyusukeIwata | 12:f52c96610b21 | 9 | int addr_accel; |
RyusukeIwata | 12:f52c96610b21 | 10 | int addr_gyro; |
hepta2ume | 0:5aaec0996753 | 11 | int addr_compus; |
umeume | 2:306058b9d04e | 12 | Hepta9axis( |
hepta2ume | 0:5aaec0996753 | 13 | PinName sda, |
hepta2ume | 0:5aaec0996753 | 14 | PinName scl, |
hepta2ume | 0:5aaec0996753 | 15 | int aaddr, |
RyusukeIwata | 12:f52c96610b21 | 16 | int agaddr, |
RyusukeIwata | 12:f52c96610b21 | 17 | int amaddr |
hepta2ume | 0:5aaec0996753 | 18 | ); |
hepta2ume | 0:5aaec0996753 | 19 | void setup(); |
hepta2ume | 0:5aaec0996753 | 20 | void sen_acc(float *ax,float *ay,float *az); |
hepta2ume | 0:5aaec0996753 | 21 | void sen_gyro(float *gx,float *gy,float *gz); |
hepta2ume | 0:5aaec0996753 | 22 | void sen_mag(float *mx,float *my,float *mz); |
hepta2ume | 0:5aaec0996753 | 23 | |
hepta2ume | 0:5aaec0996753 | 24 | private: |
hepta2ume | 0:5aaec0996753 | 25 | char g1[8],g2[8]; |
hepta2ume | 0:5aaec0996753 | 26 | char a1[8],a2[8]; |
hepta2ume | 0:5aaec0996753 | 27 | char m1[8],m2[8]; |
HEPTA | 4:01941772f493 | 28 | short int st2; |
hepta2ume | 0:5aaec0996753 | 29 | short int xl,xh,yl,yh,zl,zh; |
hepta2ume | 0:5aaec0996753 | 30 | short int gxl,gxh,gyl,gyh,gzl,gzh; |
hepta2ume | 0:5aaec0996753 | 31 | short int mxl,mxh,myl,myh,mzl,mzh; |
csmk18112 | 10:2b227e8928ae | 32 | |
csmk18112 | 10:2b227e8928ae | 33 | float accel[3]; |
csmk18112 | 10:2b227e8928ae | 34 | float magnet[3]; |
csmk18112 | 10:2b227e8928ae | 35 | float gyroscope[3]; |
csmk18112 | 10:2b227e8928ae | 36 | char cmd[2]; |
csmk18112 | 10:2b227e8928ae | 37 | uint8_t data[8]; |
csmk18112 | 10:2b227e8928ae | 38 | char send[1], get[1]; |
csmk18112 | 10:2b227e8928ae | 39 | char temp; |
hepta2ume | 0:5aaec0996753 | 40 | |
hepta2ume | 0:5aaec0996753 | 41 | }; |
hepta2ume | 0:5aaec0996753 | 42 | |
hepta2ume | 0:5aaec0996753 | 43 | #endif |