From 68bdaee1cc301a2aca1849f38d2596debe7d67d1 Mon Sep 17 00:00:00 2001 From: Jean-François Milants Date: Wed, 31 Mar 2021 19:47:27 +0200 Subject: First integration of the motion sensor (bma 421) : step counting + wake on wrist rotation + app to see the value of the 3 axis in "real time". --- src/displayapp/screens/WatchFaceDigital.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/displayapp/screens/WatchFaceDigital.cpp') diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp index c39fe496..2204e177 100644 --- a/src/displayapp/screens/WatchFaceDigital.cpp +++ b/src/displayapp/screens/WatchFaceDigital.cpp @@ -11,6 +11,7 @@ #include "components/ble/BleController.h" #include "components/ble/NotificationManager.h" #include "components/heartrate/HeartRateController.h" +#include "components/motion/MotionController.h" #include "components/settings/Settings.h" #include "../DisplayApp.h" @@ -23,11 +24,13 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app, Controllers::Ble& bleController, Controllers::NotificationManager& notificatioManager, Controllers::Settings &settingsController, - Controllers::HeartRateController& heartRateController): Screen(app), currentDateTime{{}}, + Controllers::HeartRateController& heartRateController, + Controllers::MotionController& motionController) : Screen(app), currentDateTime{{}}, dateTimeController{dateTimeController}, batteryController{batteryController}, bleController{bleController}, notificatioManager{notificatioManager}, settingsController{settingsController}, - heartRateController{heartRateController} { + heartRateController{heartRateController}, + motionController{motionController} { settingsController.SetClockFace(0); displayedChar[0] = 0; @@ -236,7 +239,7 @@ bool WatchFaceDigital::Refresh() { lv_obj_align(heartbeatBpm, heartbeatValue, LV_ALIGN_OUT_RIGHT_MID, 5, 0); } - // TODO stepCount = stepController.GetValue(); + stepCount = motionController.NbSteps(); if(stepCount.IsUpdated()) { char stepBuffer[5]; sprintf(stepBuffer, "%lu", stepCount.Get()); -- cgit v1.2.3-70-g09d2