MMA7361L interface
Dependents: MMA7361L_Example ARLISS2012_Hidaka
Diff: MMA7361L.cpp
- Revision:
- 2:ce1a0d55f3c9
- Parent:
- 1:19444721f19a
diff -r 19444721f19a -r ce1a0d55f3c9 MMA7361L.cpp --- a/MMA7361L.cpp Wed Apr 25 10:13:30 2012 +0000 +++ b/MMA7361L.cpp Mon May 20 05:24:57 2013 +0000 @@ -1,13 +1,13 @@ #include "MMA7361L.h" MMA7361L::MMA7361L(PinName xoutPin, PinName youtPin,PinName zoutPin, - PinName zeroGDetectPin, PinName gSelectPin, PinName sleepPin) : + PinName zeroGDetectPin, PinName gSelectPin, PinName nSleepPin) : xout(xoutPin), yout(youtPin), zout(zoutPin), - zeroGDetect(zeroGDetectPin), gSelect(gSelectPin), sleep(sleepPin), + zeroGDetect(zeroGDetectPin), gSelect(gSelectPin), nSleep(nSleepPin), flags(-1) { zeroGDetectEnabled = zeroGDetectPin != NC; gSelectEnabled = gSelectPin != NC; - sleepEnabled = sleepPin != NC; + sleepEnabled = nSleepPin != NC; setSleep(false); setScale(SCALE_1_5G); for (int i = 0; i < 2; i++) { @@ -74,7 +74,7 @@ void MMA7361L::setSleep(bool on) { if (sleepEnabled) - sleep = !on; + nSleep = !on; } bool MMA7361L::zeroGDetected() { @@ -127,7 +127,7 @@ "sleepEnabled = %d\n" "zeroGDetect(InterruptIn) = %d\n" "gSelect(DigitalOut) = %d\n" - "sleep(DigitalOut) = %d\n" + "nSleep(DigitalOut) = %d\n" "scale = %d\n" "accelX, accelY, accelZ = %4.3f, %4.3f, %4.3f\n" "calib (1.5G) = %4.3f, %4.3f; %4.3f, %4.3f; %4.3f, %4.3f\n" @@ -138,7 +138,7 @@ sleepEnabled, zeroGDetectEnabled ? zeroGDetect.read() : -1, gSelectEnabled ? gSelect.read() : -1, - sleepEnabled ? sleep.read() : -1, + sleepEnabled ? nSleep.read() : -1, scale, accelX, accelY, accelZ, calib[0].minX, calib[0].maxX, calib[0].minY, calib[0].maxY, calib[0].minZ, calib[0].maxZ,