comments and low energy sampling
This commit is contained in:
parent
db1750ef53
commit
e2f57bad76
5 changed files with 67 additions and 19 deletions
|
|
@ -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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue