Nora Vazbyte
/
99Problems-BLEAint1
app critics will say it's money, cash, toes
Diff: source/main.cpp
- Revision:
- 11:5023e8c93e4d
- Parent:
- 10:8cf4069d064a
- Child:
- 12:3934b9d6d5a3
--- a/source/main.cpp Wed Nov 07 19:30:43 2018 +0000 +++ b/source/main.cpp Thu Nov 08 11:47:07 2018 +0000 @@ -16,7 +16,7 @@ #include <events/mbed_events.h> #include <math.h> -#include <chrono> + #include <ctime> #include <mbed.h> #include "MPU9250.h" @@ -64,13 +64,17 @@ double accel = sqrt(sum_acc); int step = 0; - - namespace sc = std::chrono; - auto time = sc::system_clock::now(); // get the current time - auto millis = sc::duration_cast<sc::milliseconds>(time); - timeCurrent = millis.count(); + + timeCurrent = (unsigned long) clock(); + + + printf("timeCurrent: " ); + printf("%ld\n", timeCurrent); + + printf("lastStepTime: " ); + printf("%ld\n", lastStepTime); - if (accel < step_threshold && oldAcceleration >= step_threshold && (timeCurrent - lastStepTime > STEP_DELAY)) { + if (accel < step_threshold && oldAcceleration >= step_threshold && (timeCurrent - lastStepTime > step_delay)) { step = 1; lastStepTime = timeCurrent; }