diff options
| author | Jean-François Milants <jf@codingfield.com> | 2021-03-31 17:47:27 (GMT) |
|---|---|---|
| committer | Jean-François Milants <jf@codingfield.com> | 2021-04-04 13:56:04 (GMT) |
| commit | 68bdaee1cc301a2aca1849f38d2596debe7d67d1 (patch) | |
| tree | 00f3bd9a1554c286aa2d5bd3a86bcfcdf7ba7171 /src/displayapp/screens/Motion.h | |
| parent | 04fc33e2d479161ec261f932b908dffbd73e227f (diff) | |
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".
Diffstat (limited to 'src/displayapp/screens/Motion.h')
| -rw-r--r-- | src/displayapp/screens/Motion.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/displayapp/screens/Motion.h b/src/displayapp/screens/Motion.h new file mode 100644 index 0000000..ad1341a --- /dev/null +++ b/src/displayapp/screens/Motion.h @@ -0,0 +1,39 @@ +#pragma once + +#include <cstdint> +#include <chrono> +#include "Screen.h" +#include <bits/unique_ptr.h> +#include <libs/lvgl/src/lv_core/lv_style.h> +#include <libs/lvgl/src/lv_core/lv_obj.h> +#include <components/motion/MotionController.h> + +namespace Pinetime { + namespace Applications { + namespace Screens { + + class Motion : public Screen{ + public: + Motion(DisplayApp* app, Controllers::MotionController& motionController); + ~Motion() override; + + bool Refresh() override; + bool OnButtonPushed() override; + + private: + Controllers::MotionController& motionController; + lv_obj_t * chart; + lv_chart_series_t * ser1; + lv_chart_series_t * ser2; + lv_chart_series_t * ser3; + + lv_obj_t* labelStep; + lv_obj_t* labelStepValue; + static constexpr uint8_t nbStepsBufferSize = 9; + char nbStepsBuffer[nbStepsBufferSize+1]; + bool running = true; + + }; + } + } +}
\ No newline at end of file |
