Home/Support/Support Forum/XBee series 2 AT mode and 2 arduinos

XBee series 2 AT mode and 2 arduinos

0 votes
I have 2 xbees series 2 and have them configured to send information back and forth so I wanted to use a pot and servo and I am about to send values and read them using XCTU. The numerical values show on the the receiving xbee. When I connect it to the arduino I am getting -1 and thats the only thing I receive. I know there has to be an easy solution.

Thanks in advance for any help

Transmit Code

int potPin = 0;
#include <XBee.h>

XBee xbee = XBee();
void setup() {
// Serial port enable

void loop() {

// remap values from the analogValue5 variable to 0 / 255
int val = map(analogRead(potPin), 0, 1023, 0, 9);

// send the value to the serial port


Receive Code

#include <Servo.h>

int servoPin = 9;
Servo myservo;
void setup() {



void loop() {


int data = Serial.read();
int pos = map(data, 0, 9, 0, 180);
pos = constrain(pos, 0, 180);


asked Jun 22, 2015 in RF Solutions and XBee by sjb New to the Community (0 points)

Please log in or register to answer this question.

1 Answer

0 votes
I believe this is a duplicate post. If not, please state so.
answered Sep 4, 2015 by mvut Veteran of the Digi Community (15,108 points)