comments and low energy sampling

This commit is contained in:
Clemens-Dautermann 2022-02-06 13:04:01 +01:00 committed by Clemens-Dautermann
parent db1750ef53
commit e2f57bad76
5 changed files with 67 additions and 19 deletions

View file

@ -2,15 +2,20 @@
#include <sensors/BmpSensor.h>
#define SLEEP_TIME 2
#define BAUD_RATE 112500
Sensor *bmpSensor;
void setup() {
Serial.begin(BAUD_RATE);
bmpSensor = new BmpSensor();
}
void loop() {
bmpSensor->sample();
bmpSensor->enableStandbyMode();
sensor_data_t sample = ((BmpSensor *) bmpSensor)->sampleLowEnergy();
Serial.printf("Temperature: %f | Pressure: %f \n",
sample.temperature,
sample.pressure
);
delay(SLEEP_TIME * 1000);
}