| ... | ... | @@ -160,9 +160,12 @@ In `src/entrypoints` add a file called `test-tempsensor.cpp`. |
|
|
|
|
|
|
|
A simple entrypoint creates a `TempSensor` object and periodically reads the temperature value:
|
|
|
|
```cpp
|
|
|
|
#include <miosix.h>
|
|
|
|
#include <Common.h>
|
|
|
|
#include "TempSensor.h"
|
|
|
|
|
|
|
|
using namespace miosix;
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
TempSensor temp_driver(TempSensor::OutputDataRate::ODR_100_HZ,
|
| ... | ... | @@ -174,7 +177,7 @@ int main() |
|
|
|
{
|
|
|
|
TRACE("Temp : %d °C \n", temp_driver.getTemperature());
|
|
|
|
|
|
|
|
delayMs(2000);
|
|
|
|
Thread::sleep(2000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
| ... | ... | |