mirror of
https://github.com/eclipse/upm.git
synced 2025-03-14 20:47:30 +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
18
README.md
18
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);
|
||||
}
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user