Xbee arduino help

alright so i have a few questions. i plug my xbees in and configure them to communicate with eachother i hook them up to the arduino upload code and thats it or am i missing somthing plz help

Thank You

It would have taken less time for you to actually try this than to type the message on the forum. Sometimes its better to try things for yourself. This is one of those times.

But, yes, that's all you need to do.

alright cool i just had to make sure because both of my xbee;s arnt working right i cant configure them they are not reaading in XCTU

both of my xbee;s arnt working right

If you can't configure them using a tool provided by the manufacturer of the XBee, it is unlikely that they will perform properly when installed on the shields and attached to the Arduinos. But, you might get lucky. Buy a lottery ticket, too.

I have them connected to my Xbee right now on my shield that's how I configure them

Attaching the XBee to the shield, and attaching the shield to the Arduino, and using that to configure the XBee only works if you've removed the ATMega chip from the Arduino board. Have you done that?

Of course, you need to remove the shield and re-insert the ATMega chip after configuring the XBees.

hahaha aqlright thats what was missing so now they are both working... thank you so much. but now i have the TX to TX from the aruino to the xbee shield. ame with the RX's. So after i configured them i tested them in terminal and works properly. So i just pluged them into the arduino upload code program and uploaded code to them. No luck. the code uploads alright but nothing happens after

At this point, I guess we need to see the code you are trying to run on each of the Arduinos.

Send:

int potPin = 5;

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

void loop()
{
   int potVal = analogRead(5);
   byte servoVal = map(potVal, 520, 0, 500, 4000);

   Serial.write(servoVal);
   delay(10);
}

Receive:

#include <Servo.h>

Servo myservo;  // create servo object to control a servo

void setup()
{
   Serial.begin(9600);
   myservo.attach(5);  // attaches the servo on pin 9 to the servo object
}

void loop()
{
   if(Serial.available() > 0)
   {
    byte servoAng = Serial.read();

    // Send the servo to the position read... <-- you get to make this happen
    myservo.write(servoAng);
   }
}
   byte servoVal = map(potVal, 520, 0, 500, 4000);

You have a from range that goes from 520 to 0. What will happen when the value read from the potentiometer is greater than 520?

You have a too range from 500 to 400. That means that any value in the from range will result in an output that will not fit in a byte.

Since you are using the Servo library on the receiver, the value that you want to send is the angle that the servo is to be moved to. The value that you are sending it is a pulse width that causes the servo to hold still.

The function that you are using on the receiver expects an angle value. 500 to 4000 are not valid angle values.

Do the red and green lights on the shields flash when the XBee sends and receives data?

yes when the xbees have power the green LED's blink and when i had them in terminal to test them the recieving one had a glowing red LED but after i upload code both of them just blink green no red.

And i looked online and so would this setup work for the map function:

val = map(val,[glow] 0, 1023, 0, 255[/glow]);

It would, but you can't make a servo go to 255 degrees. The upper and lower limit of the to range needs to match what your servo can physically do.

XBees don't have LEDs. Shields do. Remind me again which shield you have.

http://ladyada.net/make/xbee/ I have this shield

So I have a backs parallax servo what do u think the map function would be

http://ladyada.net/make/xbee/ I have this shield

So I have a backs parallax servo what do u think the map function would be

http://ladyada.net/make/xbee/ I have this shield

So I have a backs parallax servo what do u think the map function would be

Paul can you please help i have been waiting a couple days for help

Thank You

Posting the same thing over and over isn't going to get you help any faster...

Try byte servoValue; int val; val = analogRead(analogPin) servoValue = map(val, 0, 1023, 0, 180);

Also instead of using Serial.write try using just Serial.print(value).

You might want to increase the delay a bit, you're sending out once every 10 MS even if the value hasn't changed. You might get some "repeat" numbers when it tries to resend values it misses.

And you haven't said anything about what MORE you've tried YOURSELF... Maybe research online? There are a large amount of examples for interfacing the Arduino with Xbee, you might have figured out your own problem in half the time you spent "waiting" for an answer. :)

ya that didnt work. I no my xbees are working right because i tseted them in terminal with out the atmega chip and when i plug the chip back in XCTU id it suppose to pick ur the xbee modem type and stuff? And do i upload the code with the xbee hooked up?

And do i upload the code with the xbee hooked up?

Nope. You'll need to unconnect your Xbee each time you upload.

and No again. If the chip is plugged into the board and you try to use the same pins for the XBEE, you'll just have problems.

SO, I'm curious... have you tried anything other than a servo? Did you try simple with an LED just to see if you can turn it off and on via the Arduino? (or computer, depending on how you have the two hooked up)

It's usually best to start small and work your way up.. that way you can eliminate issues, such as hardware.

Also a few things that gets people turned around: Make SURE your Arduino is using the correct Baud rate. (9600 is default) Try switching the RX and TX lines.

Can u give me some simple code for an led

can someone please respond and help me out saying liek the procces after you config the xbees like how to upload the code and everything please helpme