-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #170 from kike-canaries/devel
Devel
- Loading branch information
Showing
8 changed files
with
180 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* @file main.cpp | ||
* @date June 2018 - 2021 | ||
* @brief Particle meter sensor tests | ||
* @license GPL3 | ||
* | ||
* Full documentation: | ||
* https://github.com/kike-canaries/canairio_sensorlib#canairio-air-quality-sensors-library | ||
* | ||
* Full implementation for WiFi and Bluetooth Air Quality fixed and mobile station: | ||
* https://github.com/kike-canaries/canairio_firmware#canairio-firmware | ||
* | ||
* CanAirIO project: | ||
* https://canair.io | ||
*/ | ||
|
||
#include <Arduino.h> | ||
|
||
#include <Sensors.hpp> | ||
|
||
void onSensorDataOk() { | ||
Serial.println("-->[MAIN] NH3: " + String(sensors.getNH3())); | ||
Serial.println("-->[MAIN] CO: " + String(sensors.getCO())); | ||
} | ||
|
||
void onSensorDataError(const char* msg) { | ||
Serial.println(msg); | ||
} | ||
|
||
/****************************************************************************** | ||
* M A I N | ||
******************************************************************************/ | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
delay(200); | ||
Serial.println("\n== Sensor test setup ==\n"); | ||
|
||
Serial.println("-->[SETUP] Detecting sensors.."); | ||
|
||
sensors.setSampleTime(5); // config sensors sample time interval | ||
sensors.setOnDataCallBack(&onSensorDataOk); // all data read callback | ||
sensors.setOnErrorCallBack(&onSensorDataError); // [optional] error callback | ||
sensors.setDebugMode(false); // [optional] debug mode | ||
sensors.detectI2COnly(true); // force to only i2c sensors | ||
|
||
sensors.init(SENSORS::SDFRCO); // detect CO sensor | ||
sensors.init(SENSORS::SDFRNH3); // detect NH3 sensor | ||
|
||
delay(500); | ||
} | ||
|
||
void loop() { | ||
sensors.loop(); // read sensor data and showed it | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
name=CanAirIO Air Quality Sensors Library | ||
version=0.6.7 | ||
version=0.6.8 | ||
author=@hpsaturn, CanAirIO project <[email protected]> | ||
maintainer=Antonio Vanegas <[email protected]> | ||
url=https://github.com/kike-canaries/canairio_sensorlib | ||
sentence=Air quality particle meter and CO2 sensors manager for multiple models. | ||
paragraph=Generic sensor manager, abstratctions and bindings of multiple air sensors libraries: Honeywell, Plantower, Panasonic, Sensirion, Nova, etc. and CO2 sensors. Also it handling others environment sensors. This library is for general purpose but also is the sensors library base of CanAirIO project. | ||
category=sensors | ||
depends=AM232X,Adafruit Unified Sensor,sps30,Adafruit BME280 Library,AHT10,Adafruit BusIO,Adafruit SHT31 Library,DHT_nonblocking,MH-Z19,SparkFun SCD30 Arduino Library,CM1106_UART,SN-GCJA5,Adafruit BME680 Library,S8_UART,Sensirion I2C SCD4x | ||
depends=AM232X,Adafruit Unified Sensor,sps30,Adafruit BME280 Library,AHT10,Adafruit BusIO,Adafruit SHT31 Library,DHT_nonblocking,MH-Z19,SparkFun SCD30 Arduino Library,CM1106_UART,SN-GCJA5,Adafruit BME680 Library,S8_UART,Sensirion I2C SCD4x,DFRobot_MultiGasSensor | ||
license=GPL-3.0-only |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.