//#include "DHT.h"
//#define DHTPIN 2 // Digital pin connected to the DHT sensor
//#define DHTTYPE DHT11 // DHT 11
//DHT dht(DHTPIN, DHTTYPE);
// Configuration of Analog input and outputs
int sensorPin0 = A0; // select the input pin for the potentiometer
int sensorPin2 = A2;
int sensorPin4 = A4;
int sensorValue0 = 0; // variable to store the value coming from the sensor
int sensorValue2 = 0; // variable to store the value coming from the sensor
int sensorValue4 = 0; // variable to store the value coming from the sensor
int Value0 = 0; // variable to store the value coming from the sensor
int Value2 = 0; // variable to store the value coming from the sensor
int Value4 = 0; // variable to store the value coming from the sensor
int Final_Value0 = 0;
int Final_Value2 = 0;
int Final_Value4 = 0;
int i = 0;
const int nodeID = 5;
int h = 0.0;
int t = 0.0;
void setup() {
Serial.begin(38400);
//dht.begin();
}
void loop ()
{
//h = dht.readHumidity();
//t = dht.readTemperature();
sensorValue0 = analogRead(sensorPin0);
sensorValue2 = analogRead(sensorPin2);
sensorValue4 = analogRead(sensorPin4);
Value0 = Value0+sensorValue0;
Value2 = Value2+sensorValue2;
Value4 = Value4+sensorValue4;
i = i+1;
if (i==10)
{
Final_Value0 = Value0/10;
Final_Value2 = Value2/10;
Final_Value4 = Value4/10;
Value0 = 0; // variable to store the value coming from the sensor
Value2 = 0; // variable to store the value coming from the sensor
Value4 = 0;
i = 0;
}
Serial.print(nodeID); Serial.print(' ');
Serial.print(Final_Value0); Serial.print(" "); // These for compatibilit$
Serial.print(Final_Value2); Serial.print(" ");
Serial.print(Final_Value4); Serial.print(" ");
Serial.print(h); Serial.print(" ");
Serial.print(t); Serial.println();
delay(1000);
}