From 13d86ba88fee257169a2c6836be962a027a8124c Mon Sep 17 00:00:00 2001 From: Marcus Date: Mon, 18 Nov 2024 13:18:10 +0100 Subject: [PATCH] add missing files --- Arduino/CanGrow/include/Sensor/02_BME280.h | 47 ++++++++++++++++ Arduino/CanGrow/include/Sensor/Common.h | 64 ++++++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 Arduino/CanGrow/include/Sensor/02_BME280.h create mode 100644 Arduino/CanGrow/include/Sensor/Common.h diff --git a/Arduino/CanGrow/include/Sensor/02_BME280.h b/Arduino/CanGrow/include/Sensor/02_BME280.h new file mode 100644 index 0000000..915eab0 --- /dev/null +++ b/Arduino/CanGrow/include/Sensor/02_BME280.h @@ -0,0 +1,47 @@ +/* + * + * include/Sensor/00_ADC_builtin.h - sensor header for BME280 I2C sensor + * + * + * MIT License + * + * Copyright (c) 2024 DeltaLima + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#include + + +#define SENSOR_02_NAME "BME280" +#define BME280_MAX 2 + +const byte SENSOR_02_READINGS[] = { + SENSOR_READING_TEMP, + SENSOR_READING_HUMIDITY, + SENSOR_READING_PRESSURE }; + + +Adafruit_BME280 BME280[BME280_MAX]; + +void Sensor_Bme280_Init(byte sensorId) { + +} diff --git a/Arduino/CanGrow/include/Sensor/Common.h b/Arduino/CanGrow/include/Sensor/Common.h new file mode 100644 index 0000000..b79450c --- /dev/null +++ b/Arduino/CanGrow/include/Sensor/Common.h @@ -0,0 +1,64 @@ +/* + * + * include/Sensor/Common.h - common sensor header file + * + * + * MIT License + * + * Copyright (c) 2024 DeltaLima + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + + +/* + * Common used consts and variables, used within the Sensor header for example + */ + +// for bme280 and bme680 +#define SEALEVELPRESSURE_HPA (1013.25) + +// How much values can a sensor return +const byte SENSOR_MAX_READING = 8; + +const byte SENSOR_READING_RAW = 1; +const byte SENSOR_READING_TEMP = 2; +const byte SENSOR_READING_HUMIDITY = 3; +const byte SENSOR_READING_MOISTURE = 4; +const byte SENSOR_READING_PRESSURE = 5; +const byte SENSOR_READING_GAS_RESISTANCE = 6; + +const char SENSOR_READING_RAW_descr[] = "Raw Analog"; +const char SENSOR_READING_TEMP_descr[] = "Temperature °C"; +const char SENSOR_READING_HUMIDITY_descr[] = "Humidity %"; +const char SENSOR_READING_MOISTURE_descr[] = "Moisture %"; +const char SENSOR_READING_PRESSURE_descr[] = "Pressure Pa"; +const char SENSOR_READING_GAS_RESISTANCE_descr[] = "Gas resistance KOhm"; + +const char * Sensor_Reading_descr[] = { + NULL, // 0 is unset + SENSOR_READING_RAW_descr, + SENSOR_READING_TEMP_descr, + SENSOR_READING_HUMIDITY_descr, + SENSOR_READING_MOISTURE_descr, + SENSOR_READING_PRESSURE_descr, + SENSOR_READING_GAS_RESISTANCE_descr, +};