use arduino uno
This commit is contained in:
parent
93a5336344
commit
5a16fccbad
2 changed files with 16 additions and 3 deletions
|
@ -8,10 +8,11 @@
|
||||||
; Please visit documentation for the other options and examples
|
; Please visit documentation for the other options and examples
|
||||||
; https://docs.platformio.org/page/projectconf.html
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
|
; nanoatmega328new
|
||||||
|
|
||||||
[env:arduino]
|
[env:arduino]
|
||||||
platform = atmelavr
|
platform = atmelavr
|
||||||
board = nanoatmega328new
|
board = uno
|
||||||
framework = arduino
|
framework = arduino
|
||||||
lib_deps =
|
lib_deps =
|
||||||
adafruit/Adafruit BME280 Library @ ^2.1.2
|
adafruit/Adafruit BME280 Library @ ^2.1.2
|
||||||
; miguel5612/MQUnifiedsensor @ ^2.0.1
|
|
||||||
|
|
14
src/main.cpp
14
src/main.cpp
|
@ -2,7 +2,7 @@
|
||||||
#include <MQ135.h>
|
#include <MQ135.h>
|
||||||
#include <Adafruit_BME280.h>
|
#include <Adafruit_BME280.h>
|
||||||
|
|
||||||
#define PIN_MQ135 A7
|
#define PIN_MQ135 A0
|
||||||
#define PIN_NOISE 2
|
#define PIN_NOISE 2
|
||||||
#define PIN_LED_GREEN 3
|
#define PIN_LED_GREEN 3
|
||||||
#define PIN_LED_GREEN2 4
|
#define PIN_LED_GREEN2 4
|
||||||
|
@ -27,8 +27,18 @@ void loop() {
|
||||||
// float humidity = bme.readHumidity();
|
// float humidity = bme.readHumidity();
|
||||||
|
|
||||||
// float r0 = co2_sensor.getCorrectedR0(temp, humidity);
|
// float r0 = co2_sensor.getCorrectedR0(temp, humidity);
|
||||||
|
float in = analogRead(PIN_MQ135);
|
||||||
|
double v = co2_sensor.getVoltage();
|
||||||
|
double r = co2_sensor.getResistance();
|
||||||
float r0 = co2_sensor.getR0();
|
float r0 = co2_sensor.getR0();
|
||||||
|
|
||||||
|
Serial.print("Analog Read: ");
|
||||||
|
Serial.println(in);
|
||||||
|
Serial.print("Voltage: ");
|
||||||
|
Serial.println(v);
|
||||||
|
Serial.print("Resistance: ");
|
||||||
|
Serial.println(r);
|
||||||
|
|
||||||
// Serial.print("Temperature: ");
|
// Serial.print("Temperature: ");
|
||||||
// Serial.println(temp);
|
// Serial.println(temp);
|
||||||
// Serial.print("Humidity: ");
|
// Serial.print("Humidity: ");
|
||||||
|
@ -36,5 +46,7 @@ void loop() {
|
||||||
Serial.print("R0: ");
|
Serial.print("R0: ");
|
||||||
Serial.println(r0);
|
Serial.println(r0);
|
||||||
|
|
||||||
|
Serial.println("-----------------------------");
|
||||||
|
|
||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue