Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.1.0 #5

Merged
merged 6 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion .github/workflows/compile_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:

matrix:
board:
- fqbn: esp8266:esp8266:esp8285
- fqbn: esp8266:esp8266:nodemcu
- fqbn: esp8266:esp8266:nodemcuv2
- fqbn: esp8266:esp8266:d1_mini
core:
- version: 3.1.2
Expand All @@ -44,4 +46,35 @@ jobs:
libraries: |
- source-path: ./
sketch-paths:
./examples/ESP8266_example/ESP8266_example.ino
./examples/ESP8266_example/ESP8266_example.ino

build-esp32:
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, 'esp32')

strategy:
fail-fast: false

matrix:
board:
- fqbn: esp32:esp32:esp32
core:
- version: 3.0.6
- version: 3.0.7

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Compile ESP32 examples
uses: arduino/compile-sketches@v1
with:
platforms: |
- name: esp32:esp32
source-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
version: ${{ matrix.core.version }}
fqbn: ${{ matrix.board.fqbn }}
libraries: |
- source-path: ./
sketch-paths:
./examples/ESP32_example/ESP32_example.ino
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ setSensorStatus(status);

### Example
See also in:
[Arduino_example.ino](https://github.com/hasenradball/Bosch_BME280_Arduino/blob/master/examples/Arduino_example/Arduino_example.ino)
* [Arduino_example.ino](https://github.com/hasenradball/Bosch_BME280_Arduino/blob/master/examples/Arduino_example/Arduino_example.ino)
* [ESP32_example.ino](https://github.com/hasenradball/Bosch_BME280_Arduino/blob/master/examples/ESP32_example/ESP32_example.ino)
* [ESP8266_example.ino](https://github.com/hasenradball/Bosch_BME280_Arduino/blob/master/examples/ESP8266_example/ESP8266_example.ino)

```
#include <Arduino.h>
Expand Down
63 changes: 63 additions & 0 deletions examples/ESP32_example/ESP32_example.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#include <Arduino.h>
#include <Wire.h>
#include <WiFi.h>
#include <Bosch_BME280_Arduino.h>


// ============================================
// ### --- START: Klassen Instanzen --- ###
// ============================================

BME::Bosch_BME280 sensor_bme280{BME280_I2C_ADDR_PRIM, 249.76F, true};

// ============================================
// ### --- END: Klassen --- ###
// ============================================


// ============================================
// ### --- START: Setup --- ###
// ============================================
void setup() {
WiFi.mode(WIFI_OFF);
// Serielle Schnittstelle initialisieren
Serial.begin(115200);
while (!Serial) {
yield();
}
Serial.println(F("\n ### >>> ESP32 test - read Bosch BME280 Sensor Data <<< ###"));

// SDA, SCL needed for ESPs
Wire.setPins(SDA, SCL);
Wire.begin();

Serial.println(F("\t>>> init Sensor"));

sensor_bme280.begin();
}

// ============================================
// ### --- END: Setup --- ###
// ============================================

// ============================================
// ### --- START: Main Loop --- ###
// ============================================

void loop() {
static unsigned long last_ms {10000};
unsigned long ms {millis()};

if(ms - last_ms >= 10000) {
last_ms = ms;
sensor_bme280.measure();

Serial.printf("\n\n\tTemperature:\t%.2f\n", sensor_bme280.getTemperature());
Serial.printf("\tHumidity:\t%.2f\n", sensor_bme280.getHumidity());
Serial.printf("\tPressure:\t%.2f\n", sensor_bme280.getPressure());
Serial.printf("\tPressure at NN:\t%.2f\n", sensor_bme280.getSealevelForAltitude());
}
}
// ============================================
// ### --- END: Main Loop --- ###
// ============================================
2 changes: 1 addition & 1 deletion examples/ESP8266_example/ESP8266_example.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void setup() {
while (!Serial) {
yield();
}
Serial.println(F("\n ### >>> ESP01 Test - read Bosch BME280 Sensor Data <<< ###"));
Serial.println(F("\n ### >>> ESP8266 Test - read Bosch BME280 Sensor Data <<< ###"));

// SDA, SCL needed for ESPs
#if defined (ESP8266)
Expand Down