summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordragonprevost <dragon@dkp.io>2018-11-13 19:38:14 -0800
committerdragonprevost <dragon@dkp.io>2018-11-13 19:38:14 -0800
commitcaf251e70652039b5f64eb9a3b594674f1da5646 (patch)
treebdc4677a0ed3b6c298c9ba11acba4f018206e3cd
parent86b44a139649d1bc63f69dde18f27abcacb94177 (diff)
added rough example to readme
-rw-r--r--readme.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/readme.md b/readme.md
index 64b1b05..08eac0b 100644
--- a/readme.md
+++ b/readme.md
@@ -48,6 +48,32 @@ requires:
## Example
+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");
+```