Accel
Dependencies: mbed PowerControl SDFileSystem
Fork of HeptaAccel by
hepta_sat/HeptaAccel.h@0:d721efd58e4e, 2016-12-09 (annotated)
- Committer:
- tomoya123
- Date:
- Fri Dec 09 03:40:15 2016 +0000
- Revision:
- 0:d721efd58e4e
test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tomoya123 | 0:d721efd58e4e | 1 | #ifndef MBED_HEPTAACCEL_H |
tomoya123 | 0:d721efd58e4e | 2 | #define MBED_HEPTAACCEL_H |
tomoya123 | 0:d721efd58e4e | 3 | #include "mbed.h" |
tomoya123 | 0:d721efd58e4e | 4 | #define UINT14_MAX 16383 |
tomoya123 | 0:d721efd58e4e | 5 | |
tomoya123 | 0:d721efd58e4e | 6 | //3axis Accel Sensor MMA8451Q |
tomoya123 | 0:d721efd58e4e | 7 | class HeptaAccel{ |
tomoya123 | 0:d721efd58e4e | 8 | public: |
tomoya123 | 0:d721efd58e4e | 9 | I2C accel; |
tomoya123 | 0:d721efd58e4e | 10 | int addr; |
tomoya123 | 0:d721efd58e4e | 11 | HeptaAccel( |
tomoya123 | 0:d721efd58e4e | 12 | PinName sda,// Accel I2C port |
tomoya123 | 0:d721efd58e4e | 13 | PinName scl,// Accel I2C port |
tomoya123 | 0:d721efd58e4e | 14 | int aaddr |
tomoya123 | 0:d721efd58e4e | 15 | ); |
tomoya123 | 0:d721efd58e4e | 16 | void setup(); |
tomoya123 | 0:d721efd58e4e | 17 | void sensing(float *ax,float *ay,float *az); |
tomoya123 | 0:d721efd58e4e | 18 | void sensing_u16(char* ax_u16,char* ay_u16,char* az_u16, int *dsize); |
tomoya123 | 0:d721efd58e4e | 19 | float x(); |
tomoya123 | 0:d721efd58e4e | 20 | float y(); |
tomoya123 | 0:d721efd58e4e | 21 | float z(); |
tomoya123 | 0:d721efd58e4e | 22 | void x_u16(char* a_u16, int *dsize); |
tomoya123 | 0:d721efd58e4e | 23 | void y_u16(char* a_u16, int *dsize); |
tomoya123 | 0:d721efd58e4e | 24 | void z_u16(char* a_u16, int *dsize); |
tomoya123 | 0:d721efd58e4e | 25 | private: |
tomoya123 | 0:d721efd58e4e | 26 | char _cmd[2]; |
tomoya123 | 0:d721efd58e4e | 27 | short int _xmsb,_xlsb,_ymsb,_ylsb,_zmsb,_zlsb; |
tomoya123 | 0:d721efd58e4e | 28 | }; |
tomoya123 | 0:d721efd58e4e | 29 | |
tomoya123 | 0:d721efd58e4e | 30 | #endif |