I'm creating a robot that has 5 motors.I need PWM for all 5 motors. I have a arduino diecimila. What is the best way of doing this with my arduino? I know the diecimila has 3 pwm pins, but that's not enough.

The program is very simple. All it's doing is reading serial input, and changing the motor's speed according to the serial input.

There are actually 6 pwm pins on the diecimila, pins 3,5,6,8,9 and 10. So that aspect shouldn't be a problem. However, you will probably need some sort of driver circuitry to actually be able to control the motors because the Arduino pins can only source 40 milliamps.

I haven't tried one yet, though. I bought one of their I2C LCD controllers, and am moderately impressed with it: it's well-made, inexpensive, and has a well-thought-out feature set. The reason I'm only saying "moderately" is that the documentation looks good, but doesn't fully reveal or explain some of its quirks (most notably, only some of the cases where you need to give it some time to execute commands are identified). I'm having to uncover some of those quirks by experimentation.

But I'm impressed enough that I'd buy one of their chips to try out if I had a lot of servos to control, and will probably pick up one to play with for its other features.

Servo.cpp: In member function 'uint8_t Servo::attach(int)':Servo.cpp:28: error: 'digitalWrite' was not declared in this scopeServo.cpp:29: error: 'OUTPUT' was not declared in this scopeServo.cpp:29: error: 'pinMode' was not declared in this scopeServo.cpp: In member function 'void Servo::write(int)':Servo.cpp:52: error: 'clockCyclesPerMicrosecond' was not declared in this scopeServo.cpp: In static member function 'static void Servo::refresh()':Servo.cpp:74: error: 'millis' was not declared in this scopeServo.cpp:107: error: 'digitalWrite' was not declared in this scopeServo.cpp:109: error: 'TCNT0' was not declared in this scopeServo.cpp:124: error: 'digitalWrite' was not declared in this scopeo: In function `__static_initialization_and_destruction_0':F:\Documents and Settings\Ben\My Documents\Arduino\sketch_090328a\applet/sketch_090328a.cpp:6: undefined reference to `Servo::Servo()'

Couldn't determine program size: F:\Documents and Settings\Ben\Desktop\arduino-0015\hardware/tools/avr/bin/avr-size: 'F:\Documents and Settings\Ben\My Documents\Arduino\sketch_090328a\applet\sketch_090328a.hex': No such file

avrdude: can't open input file F:\Documents and Settings\Ben\My Documents\Arduino\sketch_090328a\applet\sketch_090328a.hex: No such file or directoryavrdude: write to file 'F:\Documents and Settings\Ben\My Documents\Arduino\sketch_090328a\applet\sketch_090328a.hex' failed

Some Arduino definitions were added in release 0012 that conflict with the core language if they are included in a library header file. This is generally only an issue with older libraries and is easily fixed once you know how.