From 96cb76aab6bbafe2fb86e67b79de8c3a02a5ec3d Mon Sep 17 00:00:00 2001 From: beegee-tokyo Date: Mon, 18 Sep 2023 15:42:20 +0800 Subject: [PATCH] Reverse last change. Update examples to work with RAK11200 --- README.md | 4 +- .../RAK12037-RAK11200/.rak11300.test.skip | 0 .../RAK12037-RAK11200/.rak4631.test.skip | 0 .../RAK12037-RAK11200/RAK12037-RAK11200.ino | 154 ------------------ .../IO/RAK12037_CO2_SCD30/.rak11200.test.skip | 0 .../IO/RAK12037_CO2_SCD30/.rak4631.test.skip | 0 .../.rak11200.test.skip | 0 .../.rak4631.test.skip | 0 .../.rak11200.test.skip | 0 .../.rak4631.test.skip | 0 .../RAK12037_BasicReadings_SCD30.ino | 69 -------- .../.rak11200.test.skip | 0 .../.rak4631.test.skip | 0 .../.rak11200.test.skip | 0 .../.rak4631.test.skip | 0 .../IO/RAK12037_CO2_SCD30/.rak11200.test.skip | 0 .../IO/RAK12037_CO2_SCD30/.rak11300.test.skip | 0 .../.rak11200.test.skip | 0 .../.rak11300.test.skip | 0 .../RAK12037_AutoCalibrate_SCD30.ino | 75 --------- .../.rak11200.test.skip | 0 .../.rak11300.test.skip | 0 .../.rak11200.test.skip | 0 .../.rak11300.test.skip | 0 .../RAK12037_GetSettings_SCD30.ino | 147 ----------------- .../.rak11200.test.skip | 0 .../.rak11300.test.skip | 0 .../RAK12037_SetOptions_SCD30.ino | 97 ----------- .../RAK12037_AutoCalibrate_SCD30.ino | 2 + .../RAK12037_BasicReadings_SCD30.ino | 2 + .../RAK12037_GetSettings_SCD30.ino | 2 + .../RAK12037_SetOptions_SCD30.ino | 2 + 32 files changed, 9 insertions(+), 545 deletions(-) delete mode 100644 examples/RAK11200/IO/RAK12037_CO2_SCD30/RAK12037-RAK11200/.rak11300.test.skip delete mode 100644 examples/RAK11200/IO/RAK12037_CO2_SCD30/RAK12037-RAK11200/.rak4631.test.skip delete mode 100644 examples/RAK11200/IO/RAK12037_CO2_SCD30/RAK12037-RAK11200/RAK12037-RAK11200.ino delete mode 100644 examples/RAK11300/IO/RAK12037_CO2_SCD30/.rak11200.test.skip delete mode 100644 examples/RAK11300/IO/RAK12037_CO2_SCD30/.rak4631.test.skip delete mode 100644 examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/.rak11200.test.skip delete mode 100644 examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/.rak4631.test.skip delete mode 100644 examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/.rak11200.test.skip delete mode 100644 examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/.rak4631.test.skip delete mode 100644 examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/RAK12037_BasicReadings_SCD30.ino delete mode 100644 examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/.rak11200.test.skip delete mode 100644 examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/.rak4631.test.skip delete mode 100644 examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/.rak11200.test.skip delete mode 100644 examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/.rak4631.test.skip delete mode 100644 examples/RAK4630/IO/RAK12037_CO2_SCD30/.rak11200.test.skip delete mode 100644 examples/RAK4630/IO/RAK12037_CO2_SCD30/.rak11300.test.skip delete mode 100644 examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/.rak11200.test.skip delete mode 100644 examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/.rak11300.test.skip delete mode 100644 examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/RAK12037_AutoCalibrate_SCD30.ino delete mode 100644 examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/.rak11200.test.skip delete mode 100644 examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/.rak11300.test.skip delete mode 100644 examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/.rak11200.test.skip delete mode 100644 examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/.rak11300.test.skip delete mode 100644 examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/RAK12037_GetSettings_SCD30.ino delete mode 100644 examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/.rak11200.test.skip delete mode 100644 examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/.rak11300.test.skip delete mode 100644 examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/RAK12037_SetOptions_SCD30.ino rename examples/{RAK11300 => common}/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/RAK12037_AutoCalibrate_SCD30.ino (94%) rename examples/{RAK4630 => common}/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/RAK12037_BasicReadings_SCD30.ino (93%) rename examples/{RAK11300 => common}/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/RAK12037_GetSettings_SCD30.ino (94%) rename examples/{RAK11300 => common}/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/RAK12037_SetOptions_SCD30.ino (95%) diff --git a/README.md b/README.md index f12cd461..b37e836e 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ To buy WisBlock modules please visit our [online store](https://store.rakwireles - [RAK12031_T_Fork_SX1041](/examples/common/IO/RAK12031_T_Fork_SX1041) - [RAK12035_SoilMoisture](/examples/common/IO/RAK12035_SoilMoisture) - [RAK12035_SoilMoisture](/examples/common/IO/RAK12035_SoilMoisture) + - [RAK12037_CO2_SCD30](/examples/common/IO/RAK12037_CO2_SCD30) - [RAK12039_Dust_Detection](/examples/common/IO/RAK12039_Dust_Detection) - [RAK12052 IR Array](/examples/common/IO/RAK12052) - [RAK13001_Relay_OUT_Optocoupled_IN](/examples/common/IO/RAK13001_Relay_OUT_Optocoupled_IN) @@ -198,7 +199,6 @@ To buy WisBlock modules please visit our [online store](https://store.rakwireles - [RAK5801_4-20mA](/examples/RAK4630/IO/RAK5801_4-20mA/) - [RAK5802_RS485](/examples/RAK4630/IO/RAK5802_RS485/) - [RAK5811_0-5V](/examples/RAK4630/IO/RAK5811_0-5V/) - - [RAK12037_CO2_SCD30](/examples/RAK4630/IO/RAK12037_CO2_SCD30) - [RAK15002_SD_Card](/examples/RAK4630/IO/RAK15002_SD_Card) - [RAK17000_Motor_Driver_DRV8833](/examples/RAK4630/IO/RAK17000_Motor_Driver_DRV8833) - [RAK17000_Stepper_Driver_DRV8833](/examples/RAK4630/IO/RAK17000_Stepper_Driver_DRV8833) @@ -274,7 +274,6 @@ To buy WisBlock modules please visit our [online store](https://store.rakwireles - [RAK5801_4-20mA](/examples/RAK11200/IO/RAK5801_4-20mA/) - [RAK5802_RS485](/examples/RAK11200/IO/RAK5802_RS485/) - [RAK5811_0-5V](/examples/RAK11200/IO/RAK5811_0-5V/) - - [RAK12037_CO2_SCD30](/examples/RAK11200/IO/RAK12037_CO2_SCD30) - [RAK15002_SD_Card](/examples/RAK11200/IO/RAK15002_SD_Card) - [RAK17000_Motor_Driver_DRV8833](/examples/RAK11200/IO/RAK17000_Motor_Driver_DRV8833) - [RAK17000_Stepper_Driver_DRV8833](/examples/RAK11200/IO/RAK17000_Stepper_Driver_DRV8833) @@ -330,7 +329,6 @@ To buy WisBlock modules please visit our [online store](https://store.rakwireles - [RAK5802_RS485](/examples/RAK11300/IO/RAK5802_RS485/) - [RAK5801_4-20mA](/examples/RAK11300/IO/RAK5801_4-20mA/) - [RAK5811_0-5V](/examples/RAK11300/IO/RAK5811_0-5V/) - - [RAK12037_CO2_SCD30](/examples/RAK11300/IO/RAK12037_CO2_SCD30) - [RAK15002_SD_Card](/examples/RAK11300/IO/RAK15002_SD_Card) - [RAK17000_Motor_Driver_DRV8833](/examples/RAK11300/IO/RAK17000_Motor_Driver_DRV8833) - [RAK17000_Stepper_Driver_DRV8833](/examples/RAK11300/IO/RAK17000_Stepper_Driver_DRV8833) diff --git a/examples/RAK11200/IO/RAK12037_CO2_SCD30/RAK12037-RAK11200/.rak11300.test.skip b/examples/RAK11200/IO/RAK12037_CO2_SCD30/RAK12037-RAK11200/.rak11300.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK11200/IO/RAK12037_CO2_SCD30/RAK12037-RAK11200/.rak4631.test.skip b/examples/RAK11200/IO/RAK12037_CO2_SCD30/RAK12037-RAK11200/.rak4631.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK11200/IO/RAK12037_CO2_SCD30/RAK12037-RAK11200/RAK12037-RAK11200.ino b/examples/RAK11200/IO/RAK12037_CO2_SCD30/RAK12037-RAK11200/RAK12037-RAK11200.ino deleted file mode 100644 index d5896c4c..00000000 --- a/examples/RAK11200/IO/RAK12037_CO2_SCD30/RAK12037-RAK11200/RAK12037-RAK11200.ino +++ /dev/null @@ -1,154 +0,0 @@ -/** - @file RAK12037_BasicReadings_SCD30.ino - @author rakwireless.com - @brief Example of reading SCD30 sensor and displaying data through serial port. - @version 0.1 - @date 2022-1-18 - @copyright Copyright (c) 2022 -**/ - -#include - -#include // Click here to get the library: http://librarymanager/All#Adafruit_SCD30 - -#ifdef NRF52 -#include -#endif - -Adafruit_SCD30 scd30; - -void setup() -{ - pinMode(WB_IO2, OUTPUT); - digitalWrite(WB_IO2, HIGH); - - // Initialize Serial for debug output - time_t timeout = millis(); - Serial.begin(115200); - while (!Serial) - { - if ((millis() - timeout) < 5000) - { - delay(100); - } - else - { - break; - } - } - - Serial.println("SCD30 Basic Readings Example."); - - Wire.begin(); - - if (scd30.begin() == false) - { - Serial.println("Air sensor not detected. Please check wiring. Freezing..."); - while (1) - { - delay(10); - } - } - - /*** Adjust the rate at which measurements are taken, from 2-1800 seconds */ - // if (!scd30.setMeasurementInterval(5)) { - // Serial.println("Failed to set measurement interval"); - // while(1){ delay(10);} - // } - Serial.print("Measurement interval: "); - Serial.print(scd30.getMeasurementInterval()); - Serial.println(" seconds"); - - /*** Restart continuous measurement with a pressure offset from 700 to 1400 millibar. - * Giving no argument or setting the offset to 0 will disable offset correction - */ - // if (!scd30.startContinuousMeasurement(15)){ - // Serial.println("Failed to set ambient pressure offset"); - // while(1){ delay(10);} - // } - Serial.print("Ambient pressure offset: "); - Serial.print(scd30.getAmbientPressureOffset()); - Serial.println(" mBar"); - - /*** Set an altitude offset in meters above sea level. - * Offset value stored in non-volatile memory of SCD30. - * Setting an altitude offset will override any pressure offset. - */ - // if (!scd30.setAltitudeOffset(110)){ - // Serial.println("Failed to set altitude offset"); - // while(1){ delay(10);} - // } - Serial.print("Altitude offset: "); - Serial.print(scd30.getAltitudeOffset()); - Serial.println(" meters"); - - /*** Set a temperature offset in hundredths of a degree celcius. - * Offset value stored in non-volatile memory of SCD30. - */ - // if (!scd30.setTemperatureOffset(1984)){ // 19.84 degrees celcius - // Serial.println("Failed to set temperature offset"); - // while(1){ delay(10);} - // } - Serial.print("Temperature offset: "); - Serial.print((float)scd30.getTemperatureOffset() / 100.0); - Serial.println(" degrees C"); - - /*** Force the sensor to recalibrate with the given reference value - * from 400-2000 ppm. Writing a recalibration reference will overwrite - * any previous self calibration values. - * Reference value stored in non-volatile memory of SCD30. - */ - // if (!scd30.forceRecalibrationWithReference(400)){ - // Serial.println("Failed to force recalibration with reference"); - // while(1) { delay(10); } - // } - Serial.print("Forced Recalibration reference: "); - Serial.print(scd30.getForcedCalibrationReference()); - Serial.println(" ppm"); - - /*** Enable or disable automatic self calibration (ASC). - * Parameter stored in non-volatile memory of SCD30. - * Enabling self calibration will override any previously set - * forced calibration value. - * ASC needs continuous operation with at least 1 hour - * 400ppm CO2 concentration daily. - */ - // if (!scd30.selfCalibrationEnabled(true)){ - // Serial.println("Failed to enable or disable self calibration"); - // while(1) { delay(10); } - // } - if (scd30.selfCalibrationEnabled()) - { - Serial.println("Self calibration enabled"); - } - else - { - Serial.println("Self calibration disabled"); - } -} - -void loop() -{ - if (scd30.dataReady()) - { - if (!scd30.read()) - { - Serial.println("Error reading sensor data"); - return; - } - Serial.print("co2(ppm):"); - Serial.print(scd30.CO2,3); - - Serial.print(" temp(C):"); - Serial.print(scd30.temperature, 1); - - Serial.print(" humidity(%):"); - Serial.print(scd30.relative_humidity, 1); - - Serial.println(); - } - else - Serial.println("Waiting for new data"); - - delay(3000); -} \ No newline at end of file diff --git a/examples/RAK11300/IO/RAK12037_CO2_SCD30/.rak11200.test.skip b/examples/RAK11300/IO/RAK12037_CO2_SCD30/.rak11200.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK11300/IO/RAK12037_CO2_SCD30/.rak4631.test.skip b/examples/RAK11300/IO/RAK12037_CO2_SCD30/.rak4631.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/.rak11200.test.skip b/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/.rak11200.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/.rak4631.test.skip b/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/.rak4631.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/.rak11200.test.skip b/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/.rak11200.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/.rak4631.test.skip b/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/.rak4631.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/RAK12037_BasicReadings_SCD30.ino b/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/RAK12037_BasicReadings_SCD30.ino deleted file mode 100644 index 8c698917..00000000 --- a/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/RAK12037_BasicReadings_SCD30.ino +++ /dev/null @@ -1,69 +0,0 @@ -/** - @file RAK12037_BasicReadings_SCD30.ino - @author rakwireless.com - @brief Example of reading SCD30 sensor and displaying data through serial port. - @version 0.1 - @date 2022-1-18 - @copyright Copyright (c) 2022 -**/ - -#include - -#include "SparkFun_SCD30_Arduino_Library.h" // Click here to get the library: http://librarymanager/All#SparkFun_SCD30 - -SCD30 airSensor; - -void setup() -{ - pinMode(WB_IO2, OUTPUT); - digitalWrite(WB_IO2, HIGH); - - // Initialize Serial for debug output - time_t timeout = millis(); - Serial.begin(115200); - while (!Serial) - { - if ((millis() - timeout) < 5000) - { - delay(100); - } - else - { - break; - } - } - - Serial.println("SCD30 Basic Readings Example."); - - Wire.begin(); - - if (airSensor.begin() == false) - { - Serial.println("Air sensor not detected. Please check wiring. Freezing..."); - while (1) - { - delay(10); - } - } -} - -void loop() -{ - if (airSensor.dataAvailable()) - { - Serial.print("co2(ppm):"); - Serial.print(airSensor.getCO2()); - - Serial.print(" temp(C):"); - Serial.print(airSensor.getTemperature(), 1); - - Serial.print(" humidity(%):"); - Serial.print(airSensor.getHumidity(), 1); - - Serial.println(); - } - else - Serial.println("Waiting for new data"); - - delay(3000); -} diff --git a/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/.rak11200.test.skip b/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/.rak11200.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/.rak4631.test.skip b/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/.rak4631.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/.rak11200.test.skip b/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/.rak11200.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/.rak4631.test.skip b/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/.rak4631.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK4630/IO/RAK12037_CO2_SCD30/.rak11200.test.skip b/examples/RAK4630/IO/RAK12037_CO2_SCD30/.rak11200.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK4630/IO/RAK12037_CO2_SCD30/.rak11300.test.skip b/examples/RAK4630/IO/RAK12037_CO2_SCD30/.rak11300.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/.rak11200.test.skip b/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/.rak11200.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/.rak11300.test.skip b/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/.rak11300.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/RAK12037_AutoCalibrate_SCD30.ino b/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/RAK12037_AutoCalibrate_SCD30.ino deleted file mode 100644 index 5de11403..00000000 --- a/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/RAK12037_AutoCalibrate_SCD30.ino +++ /dev/null @@ -1,75 +0,0 @@ -/** - @file RAK12037_AutoCalibrate_SCD30.ino - @author rakwireless.com - @brief SCD30 Automatic self-calibration(ASC) Example. - @version 0.1 - @date 2022-1-18 - @copyright Copyright (c) 2022 -**/ -#include - -#include "SparkFun_SCD30_Arduino_Library.h" // Click here to get the library: http://librarymanager/All#SparkFun_SCD30 - -SCD30 airSensor; - -void setup() -{ - pinMode(WB_IO2, OUTPUT); - digitalWrite(WB_IO2, HIGH); - - // Initialize Serial for debug output - time_t timeout = millis(); - Serial.begin(115200); - while (!Serial) - { - if ((millis() - timeout) < 5000) - { - delay(100); - } - else - { - break; - } - } - - Serial.println("SCD30 Automatic self-calibration Example."); - - Wire.begin(); - - //Start sensor using the Wire port and enable the auto-calibration (ASC) - if (airSensor.begin(Wire, true) == false) - { - Serial.println("Air sensor not detected. Please check wiring. Freezing..."); - while (1) - { - delay(10); - } - } - - Serial.print("Automatic self-calibration set to:"); - if (airSensor.getAutoSelfCalibration() == true) - Serial.println("true"); - else - Serial.println("false"); -} - -void loop() -{ - if (airSensor.dataAvailable()) - { - Serial.print("co2(ppm):"); - Serial.print(airSensor.getCO2()); - - Serial.print(" temp(C):"); - Serial.print(airSensor.getTemperature(), 1); - - Serial.print(" humidity(%):"); - Serial.print(airSensor.getHumidity(), 1); - - Serial.println(); - } - else - Serial.println("Waiting for new data"); - - delay(3000); -} diff --git a/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/.rak11200.test.skip b/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/.rak11200.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/.rak11300.test.skip b/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/.rak11300.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/.rak11200.test.skip b/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/.rak11200.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/.rak11300.test.skip b/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/.rak11300.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/RAK12037_GetSettings_SCD30.ino b/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/RAK12037_GetSettings_SCD30.ino deleted file mode 100644 index 028b1cc5..00000000 --- a/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/RAK12037_GetSettings_SCD30.ino +++ /dev/null @@ -1,147 +0,0 @@ -/** - @file RAK12037_GetSettings_SCD30.ino - @author rakwireless.com - @brief SCD30 get setting information example. - @version 0.1 - @date 2022-1-18 - @copyright Copyright (c) 2022 -**/ - -#include - -#include "SparkFun_SCD30_Arduino_Library.h" // Click here to get the library: http://librarymanager/All#SparkFun_SCD30 - -SCD30 airSensor; - -void setup() -{ - pinMode(WB_IO2, OUTPUT); - digitalWrite(WB_IO2, HIGH); - - // Initialize Serial for debug output - time_t timeout = millis(); - Serial.begin(115200); - while (!Serial) - { - if ((millis() - timeout) < 5000) - { - delay(100); - } - else - { - break; - } - } - Serial.println("SCD30 Get Settings Example."); - - Wire.begin(); - - // Start sensor using the Wire port, but disable the auto-calibration - if (airSensor.begin(Wire, false) == false) - { - Serial.println("Air sensor not detected. Please check wiring. Freezing..."); - while (1) - { - delay(10); - } - } - - uint16_t settingVal; // The settings will be returned in settingVal - - if (airSensor.getForcedRecalibration(&settingVal) == true) // Get the setting - { - Serial.print("Forced recalibration factor (ppm) is "); - Serial.println(settingVal); - } - else - { - Serial.print("getForcedRecalibration failed! Freezing..."); - while (1) - { - delay(10); - } - } - - if (airSensor.getMeasurementInterval(&settingVal) == true) // Get the setting - { - Serial.print("Measurement interval (s) is "); - Serial.println(settingVal); - } - else - { - Serial.print("getMeasurementInterval failed! Freezing..."); - while (1) - { - delay(10); - } - } - - if (airSensor.getTemperatureOffset(&settingVal) == true) // Get the setting - { - Serial.print("Temperature offset (C) is "); - Serial.println(((float)settingVal) / 100.0, 2); - } - else - { - Serial.print("getTemperatureOffset failed! Freezing..."); - while (1) - { - delay(10); - } - } - - if (airSensor.getAltitudeCompensation(&settingVal) == true) // Get the setting - { - Serial.print("Altitude offset (m) is "); - Serial.println(settingVal); - } - else - { - Serial.print("getAltitudeCompensation failed! Freezing..."); - while (1) - { - delay(10); - } - } - - if (airSensor.getFirmwareVersion(&settingVal) == true) // Get the setting - { - Serial.print("Firmware version is 0x"); - Serial.println(settingVal, HEX); - } - else - { - Serial.print("getFirmwareVersion! Freezing..."); - while (1) - { - delay(10); - } - } - - Serial.print("Auto calibration set to "); - if (airSensor.getAutoSelfCalibration() == true) - Serial.println("true"); - else - Serial.println("false"); -} - -void loop() -{ - if (airSensor.dataAvailable()) - { - Serial.print("co2(ppm):"); - Serial.print(airSensor.getCO2()); - - Serial.print(" temp(C):"); - Serial.print(airSensor.getTemperature(), 1); - - Serial.print(" humidity(%):"); - Serial.print(airSensor.getHumidity(), 1); - - Serial.println(); - } - else - Serial.println("Waiting for new data"); - - delay(3000); -} diff --git a/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/.rak11200.test.skip b/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/.rak11200.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/.rak11300.test.skip b/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/.rak11300.test.skip deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/RAK12037_SetOptions_SCD30.ino b/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/RAK12037_SetOptions_SCD30.ino deleted file mode 100644 index 8309a5e8..00000000 --- a/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/RAK12037_SetOptions_SCD30.ino +++ /dev/null @@ -1,97 +0,0 @@ -/** - @file RAK12037_GetSettings_SCD30.ino - @author rakwireless.com - @brief Example of SCD30 set options. - @version 0.1 - @date 2022-1-18 - @copyright Copyright (c) 2022 -**/ - -#include - -#include "SparkFun_SCD30_Arduino_Library.h" //Click here to get the library: http://librarymanager/All#SparkFun_SCD30 -SCD30 airSensor; - -void setup() -{ - pinMode(WB_IO2, OUTPUT); - digitalWrite(WB_IO2, HIGH); - - // Initialize Serial for debug output - time_t timeout = millis(); - Serial.begin(115200); - while (!Serial) - { - if ((millis() - timeout) < 5000) - { - delay(100); - } - else - { - break; - } - } - Serial.println("SCD30 Set Options Example."); - - Wire.begin(); - - if (airSensor.begin() == false) - { - Serial.println("Air sensor not detected. Please check wiring. Freezing..."); - while (1) - { - delay(10); - } - } - - // Change number of seconds between measurements: 2 to 1800 (30 minutes), stored in non-volatile memory of SCD30 - airSensor.setMeasurementInterval(16); - - // While the setting is recorded, it is not immediately available to be read. - delay(200); - - int interval = airSensor.getMeasurementInterval(); - Serial.print("Measurement Interval: "); - Serial.println(interval); - - // My desk is ~1600m above sealevel - airSensor.setAltitudeCompensation(1600); // Set altitude of the sensor in m, stored in non-volatile memory of SCD30 - - // Read altitude compensation value - unsigned int altitude = airSensor.getAltitudeCompensation(); - Serial.print("Current altitude: "); - Serial.print(altitude); - Serial.println("m"); - - // Pressure in Boulder, CO is 24.65inHg or 834.74mBar - airSensor.setAmbientPressure(835); // Current ambient pressure in mBar: 700 to 1200, will overwrite altitude compensation - - airSensor.setTemperatureOffset(5); // Optionally we can set temperature offset to 5°C, stored in non-volatile memory of SCD30 - - // Read temperature offset - float offset = airSensor.getTemperatureOffset(); - Serial.print("Current temp offset: "); - Serial.print(offset, 2); - Serial.println("C"); -} - -void loop() -{ - if (airSensor.dataAvailable()) - { - Serial.print("co2(ppm):"); - Serial.print(airSensor.getCO2()); - - Serial.print(" temp(C):"); - Serial.print(airSensor.getTemperature(), 1); - - Serial.print(" humidity(%):"); - Serial.print(airSensor.getHumidity(), 1); - - Serial.println(); - } - else - Serial.print("."); - - delay(1000); -} diff --git a/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/RAK12037_AutoCalibrate_SCD30.ino b/examples/common/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/RAK12037_AutoCalibrate_SCD30.ino similarity index 94% rename from examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/RAK12037_AutoCalibrate_SCD30.ino rename to examples/common/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/RAK12037_AutoCalibrate_SCD30.ino index 5de11403..35cf82b0 100644 --- a/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/RAK12037_AutoCalibrate_SCD30.ino +++ b/examples/common/IO/RAK12037_CO2_SCD30/RAK12037_AutoCalibrate_SCD30/RAK12037_AutoCalibrate_SCD30.ino @@ -34,6 +34,8 @@ void setup() Serial.println("SCD30 Automatic self-calibration Example."); + delay(500); + Wire.begin(); //Start sensor using the Wire port and enable the auto-calibration (ASC) diff --git a/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/RAK12037_BasicReadings_SCD30.ino b/examples/common/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/RAK12037_BasicReadings_SCD30.ino similarity index 93% rename from examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/RAK12037_BasicReadings_SCD30.ino rename to examples/common/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/RAK12037_BasicReadings_SCD30.ino index 8c698917..75644301 100644 --- a/examples/RAK4630/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/RAK12037_BasicReadings_SCD30.ino +++ b/examples/common/IO/RAK12037_CO2_SCD30/RAK12037_BasicReadings_SCD30/RAK12037_BasicReadings_SCD30.ino @@ -37,6 +37,8 @@ void setup() Wire.begin(); + delay(500); + if (airSensor.begin() == false) { Serial.println("Air sensor not detected. Please check wiring. Freezing..."); diff --git a/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/RAK12037_GetSettings_SCD30.ino b/examples/common/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/RAK12037_GetSettings_SCD30.ino similarity index 94% rename from examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/RAK12037_GetSettings_SCD30.ino rename to examples/common/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/RAK12037_GetSettings_SCD30.ino index 028b1cc5..e23f2854 100644 --- a/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/RAK12037_GetSettings_SCD30.ino +++ b/examples/common/IO/RAK12037_CO2_SCD30/RAK12037_GetSettings_SCD30/RAK12037_GetSettings_SCD30.ino @@ -36,6 +36,8 @@ void setup() Wire.begin(); + delay(500); + // Start sensor using the Wire port, but disable the auto-calibration if (airSensor.begin(Wire, false) == false) { diff --git a/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/RAK12037_SetOptions_SCD30.ino b/examples/common/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/RAK12037_SetOptions_SCD30.ino similarity index 95% rename from examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/RAK12037_SetOptions_SCD30.ino rename to examples/common/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/RAK12037_SetOptions_SCD30.ino index 8309a5e8..2f3f7504 100644 --- a/examples/RAK11300/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/RAK12037_SetOptions_SCD30.ino +++ b/examples/common/IO/RAK12037_CO2_SCD30/RAK12037_SetOptions_SCD30/RAK12037_SetOptions_SCD30.ino @@ -35,6 +35,8 @@ void setup() Wire.begin(); + delay(500); + if (airSensor.begin() == false) { Serial.println("Air sensor not detected. Please check wiring. Freezing...");