My Project
Sensors
baro.cpp
Go to the documentation of this file.
1
// Copyright (c) 2023 Samuli Nyman
2
// SPDX-License-Identifier: MIT
3
4
#include "
baro.h
"
5
#include "Arduino.h"
6
#include "LPS35HW.h"
7
#include "Wire.h"
8
9
LPS35HW
lps
;
10
11
uint8_t
initBaro
(TwoWire *wire)
12
{
if
13
14
(!
lps
.begin(wire)) {
15
return
1;
16
}
17
18
lps
.setLowPassFilter(LPS35HW::LowPassFilter_ODR20);
19
lps
.setOutputRate(LPS35HW::OutputRate_75Hz);
20
return
0;
21
}
22
23
float
readPressure
()
24
{
25
return
lps
.readPressure();
26
}
27
28
float
readTemperature
()
29
{
30
return
lps
.readTemp();
31
}
32
initBaro
uint8_t initBaro(TwoWire *wire)
Definition:
baro.cpp:11
lps
LPS35HW lps
Definition:
baro.cpp:9
readPressure
float readPressure()
Definition:
baro.cpp:23
baro.h
readTemperature
float readTemperature()
Definition:
baro.cpp:28
Generated by
1.8.17