From e6ed49427a755e99a4405ac5defbb163f818e4dd Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Wed, 5 Apr 2017 12:37:11 -0600 Subject: [PATCH] README.md: update MMA7660 snippet to reflect current reality Signed-off-by: Jon Trulson --- README.md | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index db2c10f7..d2dfa587 100644 --- a/README.md +++ b/README.md @@ -37,29 +37,21 @@ A sensor/actuator is expected to work as such (here is the MMA7660 accelerometer accel->setModeStandby(); // enable 64 samples per second - accel->setSampleRate(upm::MMA7660::AUTOSLEEP_64); - + accel->setSampleRate(MMA7660_AUTOSLEEP_64); + // place device into active mode accel->setModeActive(); while (shouldRun) { - int x, y, z; - - accel->getRawValues(&x, &y, &z); - cout << "Raw values: x = " << x - << " y = " << y - << " z = " << z - << endl; - float ax, ay, az; - + accel->getAcceleration(&ax, &ay, &az); - cout << "Acceleration: x = " << ax + cout << "Acceleration: x = " << ax << "g y = " << ay << "g z = " << az << "g" << endl; - + usleep(500000); } ```