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.
MeasurementHistory.h
- Committer:
- loicguibert
- Date:
- 2019-04-16
- Revision:
- 17:76787f5a334f
- Parent:
- 16:eed9a9ba319c
- Child:
- 18:7002e66af2e5
File content as of revision 17:76787f5a334f:
#pragma once #include <stdint.h> #include "Logger.h" class MeasurementHistory { public: // constructor MeasurementHistory(Logger logger); // Add some new values to the history void addMeasurement(uint32_t pressure, int16_t temp, uint16_t humidity, uint32_t time); uint32_t getPressureTrend(); private: struct Data { uint32_t pressure; int16_t temp; uint16_t humidity; uint32_t time; // Size: 80 bits, 10 Bytes }; // Counting the array's dimension according to max size static const int DEFAULT_SIZE = 2048; static const int ARRAY_SIZE = DEFAULT_SIZE/sizeof(Data); // data members Data m_measures[ARRAY_SIZE]; int m_measurments; Logger m_logger; };