Go Down

Topic: Xbee Pro XSC (Read 1 time) previous topic - next topic

techra

yup so ive put it at tx0 and rx0 so i didnt configure it

HazardsMind

As of right now, does it work? Also I think the Xbee needs to be off inorder to upload the code properly.

What are the error messages, if any?
Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

techra

yup that is happening,the thing is that its glowing the led whenever defined like at 0 or 1,it does go on and the rest of the times its off,but the problem is with receiving the data,its showing me values that are constant

HazardsMind

#13
Nov 17, 2012, 03:17 am Last Edit: Nov 17, 2012, 03:43 am by HazardsMind Reason: 1
I'm an idiot for not asking this before, do you know how to use an xbee or is this your first time?
If this is your first time, then please go on youtube and find some tutorials. I have a sample code here that may help you.
http://code.google.com/p/xbee-arduino/
Also watch this guy:
http://www.youtube.com/watch?v=vKVNmA8C6m8

The Xbee has it's own way of communicating to the arduino. It will not accept Serial.read or write commands, instead it has its own xbee.read and xbee.write.

HOWEVER...

If you just want to test the code you wrote, use jumper cables to simulate a connection.

Master ARD:      Slave ARD
TX  =======>    RX
RX  =======>    TX


And for your slave code, just do this:

Code: [Select]

int led = 13;


void setup()
{
  Serial.begin(9600);    // usb connection to PC, view in ARD serial monitor
  Serial1.begin(9600);  //connect to mega
  pinMode(led,OUTPUT);
  Serial.println("start on slave");
}
void loop()
{
 
if (Serial1.available() > 0) {
         digitalWrite(led,HIGH);
         char data=Serial1.read();
         Serial.print(data);
         data = ' '; // clears data for new char, (just in case)
}
else {
         digitalWrite(led,LOW);
       }
}


Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

techra

#14
Nov 17, 2012, 04:23 am Last Edit: Nov 17, 2012, 04:25 am by techra Reason: 1
its actually not the first time,ive configured it,and ive seen that video too but it doesnt help alot as ive a xbee pro xsc,but the connection is established and im using a 3v3 regulator to connect to the arduino for both my xbees,
dout=rx0(data that came ,now stored in the buffer)
din =tx0(data coming in from the arduino to transmit)
and the thing is all the codes that Ive tried till now can only do a specific function like light an led,or like jeremy blum's servo motor,but i still dont know to receive data.
The major problem with this xbee in specific is that it cant go more than 9600 baud rate,plus it works on point to point communication,so i really cant use the api mode.

Go Up