Servo library and serial communication... can they coexist???

Does anyone know the limitations when using the servo library in conjunction with serial communication??? I am trying to make servos move wirelessly through xbee series 1 modules. The xbee communication is working and I have one servo hooked up at the Rx end(1 out of 4). The weird problem is that the servo refuses to move to the data flowing in until I open up the serial monitor on the pc.... weird because the data is coming in wirelessly from the xbee (uart)... I don't know if there is a comflict between the servo library and the serial port on my UNO or MEGA boards (Rx).

Is there a better way to set this up? I am trying to keep the footprint small so using two arduinos to perform this task is something I'd like to avoid if possible....

I have an accelerometer in a FIO sending x/y data via xbee to a second xbee hooked up to an UNO using an xbee shield.. the data is processed and then mapped to values between 1000 and 2000 to use in the servo library commands...

fxmech: Does anyone know the limitations when using the servo library in conjunction with serial communication???

Nothing I know of. You mention that the xbee is on the UART so I'm presuming using D0 & D1 on the Arduino. There are XBee shields which use other digital pins for IO which could clash with the pins you're using for the servos, but I don't expect that would give you the issue you're experiencing.

fxmech: the data is processed and then mapped to values between 1000 and 2000 to use in the servo library commands...

The servo write() only accepts values between 0 and 180 so I don't know what it would do if fed values so high..?

Geoff

The servo write() only accepts values between 0 and 180 so I don't know what it would do if fed values so high..?

You've got the source - why don't you look? It may surprise you.

AWOL:

The servo write() only accepts values between 0 and 180 so I don't know what it would do if fed values so high..?

You've got the source - why don't you look? It may surprise you.

Why didn't I look? Probably because I blindly trusted the documentation - silly me. :) Now I've done so, you're right - that was surprising !

The weird problem is that the servo refuses to move to the data flowing in until I open up the serial monitor on the pc.

This may be off topic but I had a similar problem, the serial monitor resets the arduino so everything works as it should, but nothing works when you first power up the arduino. My problem was that some of my sensors needed time to powerup and settle before communicating to them, I had to put a small delay at the start of my sketch to allow for this, this delay allowed for everything to powerup and wait for instructions.

By using the serial monitor everything is already powered up and ready, it just gets a software reset when the serial monitor is opened which starts everything working as it should.

That makes perfect sense! I tried the delay and it worked great!!! BTW I wasn't using Servo Write() I was using myservo.writeMicroseconds(int) thats the reason for the high values... 1000 is one extreme of the servos range 2000 is the other and 1500 is dead center (on most commercially available rc servos)