Need Help
I am working on Project "Arduino-Xbee Wireless sensor Network with two end nodes and one coordinator"
OS: Windows 7 or Windows 8.1
Hadrware: Three series 2 Xbee Modules, Three Arduino UNO boards,Digital temp & humidity sensor(DHT 11)
Software: X-ctu(latest), Arduino IDE 1.0.5
I have succeeded in communicating End device and Coordinator,but I want to send sensed data from two end nodes simultaneously to coordinator so that they can be displayed separately.
So what changes do i need to do in both Code at arduino and at Xbee parameters..........Please help
below is code for my project:
#include <DHT.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(0,1); // RX pin 0, TX pin 1
#define DHTTYPE DHT11
int dhtPin = 2;
DHT dht(dhtPin,DHTTYPE);
void setup()
{
pinMode(dhtPin, INPUT);
Serial.begin(9600);
mySerial.begin(9600);
dht.begin();
}
void loop()
{
float h = dht.readHumidity();
float t = dht.readTemperature();
if( isnan(t) || isnan(h) )
{
Serial.println("Error:failed to Read from DHT.");
} else
{
Serial.print( " Temperature = ");
Serial.print( t );
Serial.print( "C, Humidity = ");
Serial.print( h );
Serial.println( " % ");
mySerial.print( t );
mySerial.print( "," );
mySerial.println( h );
}
delay(250);
}