diff options
author | dragonprevost <dragon@dkp.io> | 2018-11-13 19:38:14 -0800 |
---|---|---|
committer | dragonprevost <dragon@dkp.io> | 2018-11-13 19:38:14 -0800 |
commit | caf251e70652039b5f64eb9a3b594674f1da5646 (patch) | |
tree | bdc4677a0ed3b6c298c9ba11acba4f018206e3cd | |
parent | 86b44a139649d1bc63f69dde18f27abcacb94177 (diff) |
added rough example to readme
-rw-r--r-- | readme.md | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -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"); +``` |