PWM signal to motor, code has an error

I am trying to get a dc brushed motor to randomly change rpm with the code below. Problem is I get the following error and I don't know what I did wrong: "error: expected unqualified-id before numeric constant"

int PWMvalue = 0;
int DCmotorpin = 9

void setup()
    pinMode(DCmotorpin, OUTPUT);

void loop()
    PWMvalue = random(0, 255);
    analogWrite(DCmotorpin, PWMvalue);

C just can't live without enough semicolons !

oops, yup that did the trick.

well now the code compiles and uploads but the motor doesn't spin, it just makes some noise. is the code fine (i.e. does it look like it should do what i said i wanted it to do?); meaning it must be the motor?

Do you use a transistor ?

The AVR can only feed 40mA per pin. This may just be enough to make the motor buzz, not turn. The code seems ok. I'm not sure if the PWM created by the arduino is suitable for speed control. It's just at about 500Hz and commercial speed controllers use several 10kHz.

If you're also planning to let the motor run reversed, have a look at these links:

You are right once again, not enough amperage. I had tested it via the 5V output and took for granted that it would work on one of the digital pins; not the case.

I don't have any transistors, don't even know what they're used for, but I will read up on them asap. I bought the arduino so i could learn about electronics and programming; electronics always seemed like magic to me cuz I had no clue how they worked.

Thanks for the links, reading through them right now.