Library for AE-KXSD9(3 axis accelerometer Module KXSD9-2050)
Diff: KXSD9_2050.h
- Revision:
- 1:4dc1a0ac0cf1
- Parent:
- 0:809f34a09f98
diff -r 809f34a09f98 -r 4dc1a0ac0cf1 KXSD9_2050.h --- a/KXSD9_2050.h Fri May 16 14:10:09 2014 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -#ifndef KXSD9_2050_H -#define KXSD9_2050_H - -#include "mbed.h" - -class KXSD9_2050 -{ - public: - KXSD9_2050(PinName sda, PinName scl, int addr1, int addr2);//constructor - //~KXSD9_2050();//destructor(unimplemented) - void init();//initialization(required) - void read_xyz(double *x, double *y, double *z);//read each axial acceleration(unit:g) - double read_x();//read the acceleration in x-axis(unit:g) - double read_y();//read the acceleration in y-axis(unit:g) - double read_z();//read the acceleration in z-axis(unit:g) - //char read_reg(char addr);//read from KXSD9_2050 register(unimplemented) - //void write_reg(char addr, char data); //write register(unimplemented) - enum{ - XOUT_H=0x00, //the highest 8 bits of the acceleration in x-axis - XOUT_L=0x01, //the lowest 4 bits of the acceleration in x-axis - YOUT_H=0x02, //the highest 8 bits of the acceleration in y-axis - YOUT_L=0x03, //the lowest 4 bits of the acceleration in y-axis - ZOUT_H=0x04, //the highest 8 bits of the acceleration in z-axis - ZOUT_L=0x05, //the lowest 4 bits of the acceleration in z-axis - AUXOUT_H=0x06, - AUXOUT_L=0x07, - RESET_WRITE=0x0A, - CTRL_REGC=0x0C, - CTRL_REGB=0x0D, - CTRL_REGA=0x0E, - SENSITIVITY=819 - }; - private: - I2C i2c_k; - int addr_w, addr_r; -}; - -#endif \ No newline at end of file