9axis-sensor library
Hepta9axis.h@12:f52c96610b21, 22 months ago (annotated)
- Committer:
- RyusukeIwata
- Date:
- Fri Aug 19 02:44:02 2022 +0000
- Revision:
- 12:f52c96610b21
- Parent:
- 10:2b227e8928ae
- Child:
- 13:e2d6617ed02a
changed by iwata
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_gyro; |
RyusukeIwata | 12:f52c96610b21 | 10 | int addr_accel; |
RyusukeIwata | 12:f52c96610b21 | 11 | int addr_gyro; |
hepta2ume | 0:5aaec0996753 | 12 | int addr_compus; |
umeume | 2:306058b9d04e | 13 | Hepta9axis( |
hepta2ume | 0:5aaec0996753 | 14 | PinName sda, |
hepta2ume | 0:5aaec0996753 | 15 | PinName scl, |
hepta2ume | 0:5aaec0996753 | 16 | int aaddr, |
RyusukeIwata | 12:f52c96610b21 | 17 | int agaddr, |
RyusukeIwata | 12:f52c96610b21 | 18 | int amaddr |
hepta2ume | 0:5aaec0996753 | 19 | ); |
hepta2ume | 0:5aaec0996753 | 20 | void setup(); |
hepta2ume | 0:5aaec0996753 | 21 | void sen_acc(float *ax,float *ay,float *az); |
hepta2ume | 0:5aaec0996753 | 22 | void sen_gyro(float *gx,float *gy,float *gz); |
hepta2ume | 0:5aaec0996753 | 23 | void sen_mag(float *mx,float *my,float *mz); |
hepta2ume | 0:5aaec0996753 | 24 | |
hepta2ume | 0:5aaec0996753 | 25 | private: |
hepta2ume | 0:5aaec0996753 | 26 | char g1[8],g2[8]; |
hepta2ume | 0:5aaec0996753 | 27 | char a1[8],a2[8]; |
hepta2ume | 0:5aaec0996753 | 28 | char m1[8],m2[8]; |
HEPTA | 4:01941772f493 | 29 | short int st2; |
hepta2ume | 0:5aaec0996753 | 30 | short int xl,xh,yl,yh,zl,zh; |
hepta2ume | 0:5aaec0996753 | 31 | short int gxl,gxh,gyl,gyh,gzl,gzh; |
hepta2ume | 0:5aaec0996753 | 32 | short int mxl,mxh,myl,myh,mzl,mzh; |
csmk18112 | 10:2b227e8928ae | 33 | |
csmk18112 | 10:2b227e8928ae | 34 | float accel[3]; |
csmk18112 | 10:2b227e8928ae | 35 | float magnet[3]; |
csmk18112 | 10:2b227e8928ae | 36 | float gyroscope[3]; |
csmk18112 | 10:2b227e8928ae | 37 | char cmd[2]; |
csmk18112 | 10:2b227e8928ae | 38 | uint8_t data[8]; |
csmk18112 | 10:2b227e8928ae | 39 | char send[1], get[1]; |
csmk18112 | 10:2b227e8928ae | 40 | char temp; |
hepta2ume | 0:5aaec0996753 | 41 | |
hepta2ume | 0:5aaec0996753 | 42 | }; |
hepta2ume | 0:5aaec0996753 | 43 | |
hepta2ume | 0:5aaec0996753 | 44 | #endif |