Servo library works in Arduino but not in Eclipse

I'm doing my development in Eclipse (AVR-plugin). I'm having trouble with the Servo library (the one shipped with the Arduino s/w). If I try the "sweep" example in the Arduino IDE it works fine, but if built in Eclipse nothing happens.

I tried another program where the servo is switched between 1000ms and 2000ms every second. I then measured the pin with a volt meter. I can clearly see that something changes every second, but since I don't have an oscilloscope at hand I can't see the wave form.

Could it be some kind of timer issue? Does the Arduino IDE define some flags that might cause a difference in the program?

Any help is appreciated.

Ok, I dug the scope out.

With the Sweep program the whole cycle is about 1.2 ms long and the high part "sweeps" between 40 and 160us. So the timer seems to be quite off.

Any ideas?

F_CPU is wrong.

F_CPU is wrong.

No need to be calling names. ;D ;) ;D

Today it's been F_HP. One of their printers is about to meet its maker.

Just write:

define F_CPU 16000000UL together with your other includes and all should be fine.