Library for the MMA7660 triple axis accelerometer
Fork of MMA7660 by
Revision 5:e69f1571e4ea, committed 2017-02-08
- Comitter:
- co838_rosf2
- Date:
- Wed Feb 08 11:52:58 2017 +0000
- Parent:
- 2:a8e20db7901e
- Commit message:
- explicitly convert double to float
Changed in this revision
MMA7660.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/MMA7660.cpp Wed Oct 17 16:38:05 2012 +0000 +++ b/MMA7660.cpp Wed Feb 08 11:52:58 2017 +0000 @@ -1,5 +1,12 @@ #include "MMA7660.h" +/* +** +** fave_r (rosf2) change a bit the library to avoid warning compilation +** Change 0.012 to 0.012f +** +*/ + MMA7660::MMA7660(PinName sda, PinName scl, bool active) : _i2c(sda, scl) { setActive(active); @@ -36,7 +43,7 @@ if (!active) { setActive(true); active = true; - wait(0.012 + 1/samplerate); //Wait until new sample is ready, my experience is that 1/samplerate isnt needed, but datasheet says so + wait(0.012f + 1/samplerate); //Wait until new sample is ready, my experience is that 1/samplerate isnt needed, but datasheet says so } char temp[3]; @@ -171,7 +178,7 @@ { if (!active) { setActive(true); - wait(0.012 + 1/samplerate); //Wait until new sample is ready + wait(0.012f + 1/samplerate); //Wait until new sample is ready } signed char temp;