Help With Servo's

I am an IT professional and just received my Mini Arduino board. I have been trying to interface two servos to the mini on a breadboard but have been having problems. I first setup the basic 'blink' program as a starting point, this works fine. I then tried inputting the first basic portion of the servo addition. By adding the line:
#include <Servo.h>

But this results in the following errors:

C:\DOCUME~1\kdadmin\LOCALS~1\Temp\build52507.tmp\core.a(wiring.c.o): In function `delay':

C:\Arduino\lib\targets\arduino\wiring.c:50: multiple definition of `delay'

lib\targets\libraries\wiring\WApplet.o:/Users/h/wiring/wiring/core/WApplet.c:65: first defined here

/cygdrive/c/Arduino/tools/avr/bin/../lib/gcc/avr/4.0.2/../../../../avr/bin/ld: Warning: size of symbol `delay' changed from 50 in lib\targets\libraries\wiring\WApplet.o to 68 in C:\DOCUME~1\kdadmin\LOCALS~1\Temp\build52507.tmp\core.a(wiring.c.o)

C:\DOCUME~1\kdadmin\LOCALS~1\Temp\build52507.tmp\core.a(wiring.c.o): In function `delayMicroseconds':

C:\Arduino\lib\targets\arduino\wiring.c:70: multiple definition of `delayMicroseconds'

lib\targets\libraries\wiring\WApplet.o:/Users/h/wiring/wiring/core/WApplet.c:86: first defined here

/cygdrive/c/Arduino/tools/avr/bin/../lib/gcc/avr/4.0.2/../../../../avr/bin/ld: Warning: size of symbol `delayMicroseconds' changed from 24 in lib\targets\libraries\wiring\WApplet.o to 26 in C:\DOCUME~1\kdadmin\LOCALS~1\Temp\build52507.tmp\core.a(wiring.c.o)

Please help. I have a headache. Are my answers different because I am using the mini?

have you copied the servo libraries to the necessary directory? (it's an external library you must install by hand)

Hello,

Yes, I have copied the Servo Folder into the Arduino\lib\targets\libraries folder.

OK, it appears that I have fixed the initial problem. The arduino default download contains the wiring libraries pre installed. The wiring libraries already have a library called servo.h After removing the wiring libraries I am no longer receving error messages when I compile.

Now I am running the code from this page:
http://www.arduino.cc/playground/ComponentLib/Servo

This compiles properly, but when the runs and it tries to send the “Ready” to the serial port the result comes back garbled as “H???åÿ” which looks very interesting, but its not what I am looking for :stuck_out_tongue: Both the code and the application are set to 19200. Any suggestions?

Thanks

Try adding a 500mS delay just before you send the "Ready" message.

Thanks for the reply. I tried adding a full 5 second delay before the command is sent, the response is now "ÿ±?ö" which is different than the “H???åÿ”, but still not "Hello". I must be overlooking something simple.

Please help :cry:

Here is the code:

#include <Servo.h>

Servo servo1; Servo servo2;

void setup() {

pinMode(1,OUTPUT);
servo1.attach(14);
servo1.setMaximumPulse(2200);
servo2.attach(15);
Serial.begin(19200);
delay(5000);
Serial.print("Ready");
}

void loop() {

static int v = 0;

if ( Serial.available()) {
char ch = Serial.read();

switch(ch) {
case '0'...'9':
v = v * 10 + ch - '0';
break;
case 's':
servo1.write(v);
v = 0;
break;
case 'w':
servo2.write(v);
v = 0;
break;
case 'd':
servo2.detach();
break;
case 'a':
servo2.attach(15);
break;
}
}

Servo::refresh();
}

It certainly looks like a speed mismatch. Are you using the "Serial Monitor" of the arduino environment to talk to it? If so, did you notice that the monitor and the download speed have separate defaults? If not, you might try using it till you successfully see your ready message...

Yes, I am using the serial monitor within the Arduino program, and I have 19200 selected from the drop down menu.

Well that is very odd. Does the servo act as expected? When you send "45s" does the servo move to 45 degrees?

Another dumb question: Have you tried resetting the Arduino?