Skip to content

Commit

Permalink
fix examples compiled for UNO
Browse files Browse the repository at this point in the history
  • Loading branch information
pilotak committed Dec 21, 2020
1 parent 0d38062 commit d68cbc8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
12 changes: 10 additions & 2 deletions examples/LPS35HW_fast_reading/LPS35HW_fast_reading.ino
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,24 @@ LPS35HW lps;

void setup() {
while(!Serial);
Wire.begin(SDA, SCL);
Wire.setClock(400000);

Serial.begin(115200);
Serial.println("LPS barometer fast reading test");

#if defined(ESP8266)
Wire.begin(SDA, SCL);
Wire.setClock(400000);

if (!lps.begin(&Wire)) { // pass already began Wire
Serial.println("Could not find a LPS barometer, check wiring!");
while (1) {}
}
#else
if (!lps.begin()) {
Serial.println("Could not find a LPS barometer, check wiring!");
while (1) {}
}
#endif

lps.setLowPassFilter(LPS35HW::LowPassFilter_ODR20); // filter last 20 samples, default off
lps.setOutputRate(LPS35HW::OutputRate_75Hz); // optional, default is 10Hz
Expand Down
10 changes: 10 additions & 0 deletions examples/LPS35HW_low_power/LPS35HW_low_power.ino
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,20 @@ void setup() {
Serial.begin(9600);
Serial.println("LPS barometer low power test");

#if defined(ESP8266)
Wire.begin(SDA, SCL);
Wire.setClock(400000);

if (!lps.begin(&Wire)) { // pass already began Wire
Serial.println("Could not find a LPS barometer, check wiring!");
while (1) {}
}
#else
if (!lps.begin()) {
Serial.println("Could not find a LPS barometer, check wiring!");
while (1) {}
}
#endif

lps.setLowPower(true);
lps.setOutputRate(LPS35HW::OutputRate_OneShot); // get results on demand
Expand Down
10 changes: 10 additions & 0 deletions examples/LPS35HW_test/LPS35HW_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,20 @@ void setup() {
Serial.begin(9600);
Serial.println("LPS barometer test");

#if defined(ESP8266)
Wire.begin(SDA, SCL);
Wire.setClock(400000);

if (!lps.begin(&Wire)) { // pass already began Wire
Serial.println("Could not find a LPS barometer, check wiring!");
while (1) {}
}
#else
if (!lps.begin()) {
Serial.println("Could not find a LPS barometer, check wiring!");
while (1) {}
}
#endif

lps.setLowPassFilter(LPS35HW::LowPassFilter_ODR9); // filter last 9 samples, default off
lps.setOutputRate(LPS35HW::OutputRate_1Hz); // optional, default is 10Hz
Expand Down

0 comments on commit d68cbc8

Please sign in to comment.