Beginner servo problems?

I just bought the Duemilanove board. I’m trying to connect a servo for the first time. It’s a GWS S03N 2BB servo. I have attached the white wire to the digital I/0 pin labeled 2. The red wire is connected to the 5V pin and the black wire is connected to the ground pin.

I then upload the following code to the board:

#include <Servo.h> 
 
Servo myservo;

int val;
 
void setup() 
{ 
   Serial.begin(9600); 
  
   myservo.attach(2); 

   delay(1000);
   
   val = myservo.attached();

   Serial.println( val );
}

void loop() {

}

In the serial monitor I can then read that the attached()-function returns a 0 (zero). Nor does it have any effect when I add:

myservo.write(45);

Do I need to use an external powersource or is the USB-power enough?

What else could be going wrong?

I might add that I tried the setup with 2 different servos and various digital I/O pins. I also tested the I/O pins with LEDS.

OK! I solved it. It seems that I was running arduino 0016 which only allows servo control on pin 9 and 10..right? Strange though cause I downloaded my arduino environment like 2 weeks ago? And furthermore the example: Examples->Library-servo->knob (which I based my code on) was using pin 2?

It seems that I was running arduino 0016 which only allows servo control on pin 9 and 10..right? Strange though cause I downloaded my arduino environment like 2 weeks ago? And furthermore the example: Examples->Library-servo->knob (which I based my code on) was using pin 2?

0016 was only updated with 0017 a few days ago. The knob example supplied with both versions I downloaded from the arduino site use pin 9. Are you sure you didn't change it?