mirror of
https://github.com/eclipse/upm.git
synced 2025-03-24 17:30:01 +03:00
README.md: update MMA7660 snippet to reflect current reality
Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
parent
c57a0d2c30
commit
e6ed49427a
10
README.md
10
README.md
@ -37,21 +37,13 @@ A sensor/actuator is expected to work as such (here is the MMA7660 accelerometer
|
|||||||
accel->setModeStandby();
|
accel->setModeStandby();
|
||||||
|
|
||||||
// enable 64 samples per second
|
// enable 64 samples per second
|
||||||
accel->setSampleRate(upm::MMA7660::AUTOSLEEP_64);
|
accel->setSampleRate(MMA7660_AUTOSLEEP_64);
|
||||||
|
|
||||||
// place device into active mode
|
// place device into active mode
|
||||||
accel->setModeActive();
|
accel->setModeActive();
|
||||||
|
|
||||||
while (shouldRun)
|
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;
|
float ax, ay, az;
|
||||||
|
|
||||||
accel->getAcceleration(&ax, &ay, &az);
|
accel->getAcceleration(&ax, &ay, &az);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user