modified from jppang's MMA8451Q for MMA8491Q on sensor evaluation board with the FRDM-KL25Z
Fork of MMA8491Q by
Diff: MMA8491Q.cpp
- Revision:
- 1:2d4b7fadb1e6
- Parent:
- 0:41db55eef564
- Child:
- 2:b79d19bdfe10
--- a/MMA8491Q.cpp Thu Oct 10 03:20:44 2013 +0000 +++ b/MMA8491Q.cpp Mon Oct 14 15:00:36 2013 +0000 @@ -44,7 +44,14 @@ uint8_t data[2] = {REG_CTRL_REG_1, 0x01}; writeRegs(data, 2); } - +/* +MMA8491Q::MMA8491Q(PinName sda, PinName scl, int addr, PinName Xout, PinName Yout, PinName Zout) + : m_i2c(sda, scl), m_addr(addr), m_xout(Xout), m_yout(Yout), m_zout(Zout) { + // activate the peripheral + uint8_t data[2] = {REG_CTRL_REG_1, 0x01}; + writeRegs(data, 2); +} +*/ MMA8491Q::~MMA8491Q() { } uint8_t MMA8491Q::getWhoAmI() {