Device driver for the Freescale MMA845x family of accelerometers.
Fork of MMA845x by
Diff: MMA845x.cpp
- Revision:
- 1:37ddb4739f02
- Parent:
- 0:9d1e3a344e4f
- Child:
- 2:555f8ba0c959
diff -r 9d1e3a344e4f -r 37ddb4739f02 MMA845x.cpp --- a/MMA845x.cpp Fri Mar 29 21:51:11 2013 +0000 +++ b/MMA845x.cpp Thu Jan 05 06:41:39 2017 +0000 @@ -24,19 +24,17 @@ #include "MMA845x.h" -MMA845x::MMA845x(I2C &i2c, InterruptIn &int1, InterruptIn &int2, MMA845x_SA0 const i2c_addr) -{ +MMA845x::MMA845x(I2C &i2c, InterruptIn &int1, InterruptIn &int2) { _i2c = &i2c; _int1 = &int1; _int2 = &int2; - _i2c_addr = (0x1c << 2) | (i2c_addr << 0x1); + _i2c_addr = (0x1c << 2) | (0 << 0x1); return; } -void MMA845x::init(void) const -{ +void MMA845x::init(void) const { uint8_t reg_val = 0; _i2c->frequency(400000);