How to control 2 servo motors on rover?

I just got the rover with bluetooth kit, and I’m new to this Arduino board.
I’ve got a ultrasonic sensor which is working fine with atmel168 chip, and 2 servo motors which I’d like to connect together to build an “obstacle avoidance” robot.

Wondering how I’m gonna do the wiring on this board? thanks!

Good news Coleman! :slight_smile:
I’ve made the pan tilt motors work, using slightly modified arduino code “sweep”, on pin 6 and 9! works like a charm!
Thanks!

Another question about the power:
now I powered the motors using vcc and gnd on the arduino board. when the motors have a big resistance, i can see the blue LED’s on board dimmed a bit, meaning the motors are eating too much of the power on the board.
Is there anyway to connect the motors directly to the battery, but not thru the chip?

For direct connection (assuming the servos are standard and won’t consume over 45mA current) you can use three pin headers to plug them directly to digital pins (for example, one servo can be connected to pins 3, 4 and 5, and the other to pins 8, 9 and 10). You would set the pins connected to the black leads to LOW and the pins connected to the red leads to HIGH. The yellow (signal) pin you would set as the servo pin (the servo library comes with the Arduino 1.0 software - see the servo example to get more details). The DFRobotShop Rover does not come with spare headers, so hopefully you have some.

You’d need to split the wires from the battery pack between the servos and the board; ensure you have common ground (battery - servo - board).