Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: source/main.cpp
- Revision:
- 17:b4a080229f5c
- Parent:
- 16:567f06e22645
- Child:
- 18:4cbd88c0a374
--- a/source/main.cpp Wed Nov 21 10:25:58 2018 +0000
+++ b/source/main.cpp Wed Nov 21 10:38:37 2018 +0000
@@ -24,6 +24,16 @@
#include "ble/Gap.h"
#include "ble/services/HeartRateService.h"
+DigitalOut Led0(p19);
+DigitalOut Led1(p20);
+DigitalOut Led2(p11);
+DigitalOut Led3(p12);
+DigitalOut Led4(p13);
+DigitalOut Led5(p14);
+DigitalOut Led6(p15);
+DigitalOut Led7(p16);
+DigitalOut Led8(p17);
+DigitalOut Led9(p18);
DigitalOut led1(LED1, 1);
@@ -40,6 +50,8 @@
int run_threshold = 5; // used to be 7
int run_count = 0;
+int totalsteps = 0;
+
static HeartRateService* hrService;
MPU9250 mpu = MPU9250(P0_26, P0_27);
@@ -86,6 +98,27 @@
}
callback_cycles = 0;
}
+ if (step != 0)
+ {
+ printf("STEP: " );
+ printf("%i\n", step);
+
+ totalsteps++;
+
+ printf("totalSTEPs: " );
+ printf("%i\n", totalsteps);
+
+ Led0 = ((totalsteps >> 0) % 2);
+ Led1 = ((totalsteps >> 1) % 2);
+ Led2 = ((totalsteps >> 2) % 2);
+ Led3 = ((totalsteps >> 3) % 2);
+ Led4 = ((totalsteps >> 4) % 2);
+ Led5 = ((totalsteps >> 5) % 2);
+ Led6 = ((totalsteps >> 6) % 2);
+ Led7 = ((totalsteps >> 7) % 2);
+ Led8 = ((totalsteps >> 8) % 2);
+ Led9 = ((totalsteps >> 9) % 2);
+ }
oldAcceleration = accel;
