diff options
author | dragonprevost <dragon@dkp.io> | 2018-11-15 12:41:49 -0800 |
---|---|---|
committer | dragonprevost <dragon@dkp.io> | 2018-11-15 12:41:49 -0800 |
commit | dbe3864176a739d45a89417b71b71ded99656c86 (patch) | |
tree | e6d1927576ad5e129cab94cd9c5690a3f11fca69 /readme.md | |
parent | 27dec638c20271b1b8aff084385d11e74bad39c8 (diff) | |
parent | 7ba91139470e24608d255ec0156444e26133d935 (diff) |
fixed merge conflicts
Diffstat (limited to 'readme.md')
-rw-r--r-- | readme.md | 38 |
1 files changed, 36 insertions, 2 deletions
@@ -4,8 +4,7 @@ This application is designed to operate on a [MongOH Red](https://mangoh.io/mang ## Prerequisites -When cloning use ``git clone --recurse-submodule https://github.com/brnkl/motion-service.git`` -to include the util module. +When cloning use ``git clone https://github.com/brnkl/motion-service.git``. ## Building @@ -25,6 +24,7 @@ The Accelerometer measures acceleration in 3 dimensions, X, Y, and Z. These dime If adjusting the value of `DEFAUTL_THRESHOLD_MS2` keep in mind that gravity implies a motionless magnitude of -9.8m/s^2. ## Bindings +App.adef ``` ... bindings: @@ -33,6 +33,7 @@ bindings: } ... ``` +Component.cdef ``` ... requires: @@ -45,6 +46,7 @@ requires: ... ``` +<<<<<<< HEAD ## Example For getting the current acceleration ``` @@ -80,4 +82,36 @@ double xAcc[N_MAX_IMPACT_VALUES], yAcc[N_MAX_IMPACT_VALUES], zAcc[N_MAX_IMPACT_V recordRes[j++] = le_avdata_RecordFloat(ref, "impactz", zAcc[i], timestamps[i]); } +======= + +## Examples +For getting a list of impact information you may follow this example. +``` +double x_arr [array_size]; +double y_arr [array_size]; +double z_arr [array_size]; +uint64 timestamps[array_size]; + +// Fills arrays with x, y, and z acceleration that have been recorded at each impact. + +le_result_t result = getSuddenImpact(x_arr, y_arr, z_arr, timestamps); + +for (int i = 0; i < array_size; i++) + LE_INFO("X: %d - Y: %d - Z: %d - time: %ul", x_arr[i], + y_arr[i], + z_arr[i], + timestamps[i]); +``` +For receiving the current acceleration only + +``` +double x_val; +double y_val; +double z_val; + +le_result_t result = getCurrentAcceleration(x_val, y_val, z_val); + +LE_INFO("Current Acceleration: X: %d - Y: %d - Z: %d"); + +>>>>>>> 7ba91139470e24608d255ec0156444e26133d935 ``` |