... | ... | @@ -36,12 +36,12 @@ We outline three phases: |
|
|
2. When the `SensorManager` is started, for each sampler it schedules a periodic task, according to the required frequency.
|
|
|
3. From that point on, the `TaskScheduler` periodically calls the `SensorSampler` objects. When called, each sampler performs the sampling of all the sensors it manages and for each of them calls the associated callback.
|
|
|
|
|
|

|
|
|
<div align="center"><img src="images/sensor_manager/SensorManager_flowchart.png" height="500"/><br/><i></i></div><br>
|
|
|
|
|
|
## Component Structure
|
|
|
For simplicity, each arrow in the diagram describes an action and reports the phase number that action belongs to (according to the above defined phases).
|
|
|
|
|
|

|
|
|
<div align="center"><img src="images/sensor_manager/SensorManager.png" height="450"/><br/><i></i></div><br>
|
|
|
|
|
|
## Example
|
|
|
#### Step 1: Creating a sensor
|
... | ... | @@ -54,7 +54,7 @@ Include needed modules, define your sensor and the `SensorManager`. |
|
|
#include <miosix.h>
|
|
|
#include <sensors`SensorManager`.h>
|
|
|
#include "TestSensor.h"
|
|
|
`SensorManager` sensor_manager;
|
|
|
SensorManager sensor_manager;
|
|
|
TestSensor* sensor;
|
|
|
```
|
|
|
Define the callback that will be passed to the `SensorSampler`, along with the sensor.
|
... | ... | |