Libelium is offering new technical support channels, to contact with de Technical Support team to solve any issue our doubt please contact with your sales agent or visit our contact site



Post a new topicPost a reply Page 1 of 1   [ 2 posts ]
Author Message
 Post subject: Arduino, Xbee And temperature
PostPosted: Mon Oct 02, 2017 5:51 pm 

Joined: Mon Oct 02, 2017 5:39 pm
Posts: 1
i have problem with my sketch arduino.
i have 2 xbee and 2 arduino and the Xbee (transmitter) is for sending data temperetur to Xbee (reciever).
and the problem is when transmitter sending data, the data is not coming to the reciever but the sketch is still working just the data is not coming to reciever.

this is my arduino sketch for Xbee(transmitter) :

#include <SoftwareSerial.h>
SoftwareSerial XBee(9, 10); // RX, TX

int InTemp = A1;
int dataTemp;

void setup()
{
XBee.begin(9600);
Serial.begin(9600);
}

void loop()
{
dataTemp = analogRead(InTemp);
float Temp = (dataTemp/1024.0)*5000;
float Cel = Temp/10 ;
float far = (Cel*9)/5 +32 ;

Serial.print("Temperature=");
Serial.print(Cel);
Serial.print("C");
Serial.print(",");
Serial.print(far);
Serial.print("F");
Serial.println();
delay(1000);


if (Serial.available())
{
XBee.write(Serial.read());
}
if (XBee.available())
{
Serial.write(XBee.read());
}
}

help help and correct my sketch and i'm so sorry for my bad english. thx


Top
 Profile  
 
 Post subject: Re: Arduino, Xbee And temperature
PostPosted: Tue Oct 03, 2017 7:12 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11366
Hi CallMeBlack,

Why do you use SoftwareSerial??

Have you configured the XBees with the same parameters?

Which XBees are you using?? How do you connect them to de Arduino?

Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 2 posts ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use.