projects
/
weathermon.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
6c7c64d
)
Добавлена обработка датчика содержания примесей в атмосфере (MQ-серия, аналоговый...
author
Roman Bazalevsky
<rvb@rvb.name>
Sat, 25 Oct 2014 12:38:24 +0000
(16:38 +0400)
committer
Roman Bazalevsky
<rvb@rvb.name>
Sat, 25 Oct 2014 12:38:24 +0000
(16:38 +0400)
Weather_WH2.ino
patch
|
blob
|
history
diff --git
a/Weather_WH2.ino
b/Weather_WH2.ino
index 175721e012753060a10e1db7227d2d6eabbbcce0..a61dbfffe7deb498e614549d9cf8b6f33e6a8081 100644
(file)
--- a/
Weather_WH2.ino
+++ b/
Weather_WH2.ino
@@
-17,7
+17,7
@@
BMP085 bmp;
// Humidity sensor at pin 4
#define DHT11PIN 5
// Humidity sensor at pin 4
#define DHT11PIN 5
-
+int sensorPin = 0;
#define DEBUG
// LED pins
#define DEBUG
// LED pins
@@
-182,6
+182,7
@@
float pressure;
void loop() {
unsigned long now;
void loop() {
unsigned long now;
+ int gas = 0;
byte i;
now = millis();
byte i;
now = millis();
@@
-258,6
+259,10
@@
void loop() {
Serial1.print(",TEMPERATURE=");
Serial1.println(temperature);
Serial1.print(",TEMPERATURE=");
Serial1.println(temperature);
+ gas = analogRead(sensorPin); // Получаем значения из датчика
+ Serial1.print("SENSOR:TYPE=GAS,VALUE=");
+ Serial1.println(gas); // Пишем в серийный порт
+
}
if ((unsigned long)(now - previousIndoor) > indoor_interval*10) {
}
if ((unsigned long)(now - previousIndoor) > indoor_interval*10) {