I can't get sevo to work right

The servo library has two functions to send data to a servo - write() and writeMicroseconds(). Continuous rotation "servos" are generally commanded using writeMicroseconds().

The values for writeMicroseconds() generally range from about 500 to about 2500. The lowest value causes fastest speed in one direction. As the values get larger, the speed gets smaller. At some point, around 1500, the "servo" stops altogether. As the values continue to increase, the direction changes, and the servo moves slowly in the other direction, increasing speed up to the upper limit.

Try a loop that calls Servo::writeMicroseconds() with values from 500 to 2500, in steps of 100, with a 1 second delay between calls.

ok here’s what i came up with…it works great

// Continous Rotation Servo Test
// By Herman O Darr (OldElectroGuy)
// June 12 2011
// Revised June 25 2011
// Use Numbers between 0 to 180...90 is usually stop
// Adjust for your servo's using the pot adjust,if installed
// this is for continous rotating servo's...not standard
// servo's from 0 to 180 degree's rotation only



//----------------------- Include's -------------------------

#include <Servo.h>

//------------------------ Variables ------------------------- 

Servo servo;             // Define servo

//-------------------------- Setup ----------------------------
void setup() { 
    servo.attach(9);     // Set servo to digital pin 9
} 
//----------------------- Main Loop ------------------------

void loop() {            // Loop through motion tests
  forward();            
  stopRobot();
  reverseslow();
  stopRobot();
  forwardslow();
  stopRobot();
  reverse();
  stopRobot();
}
//------------------------ Sub Voids ------------------------


     // Motion routines for forward, reverse, slow, and stop
void forward() {
   servo.write(0);delay(6000);   }

void reverse() {
  servo.write(180);delay(6000);    }

void stopRobot() { 
   servo.write(90);delay(5000);    }
   
void forwardslow() {
   servo.write(88);delay(6000);   }
   
void reverseslow() {
   servo.write(92);delay(6000);   }

@PaulS....yeah i did that with 1000 being forward and 2000 being reverse and 1500 being stop......if you have servo's with an adjustable pot you can set the stop with what ever number yo use....thanks for the info code

It also depends on ho the Constant Rotation servos are wired.. Even though I saw a plan for converting standard servos to C-R type, using 2x 2.2K resistors wired in series, across the old POT pins, with the center bridge to the wiper solder point, I never liked the idea of sloppy tolerance on the resistors. (and, isn't 2.2K a bit low? I thought the POTs were closer to 10K end to end?)

I've done this with modified HiTec & Futaba servos, grinding down the stop tab, and replacing the POT with a mini PC mount 10K, accessible through a side hole... Even replaced the two C-R servos on an old BOE-Bot that the motors had begun screaming.

The servo code works with the VEX Motor modules (essentially Futababa servos with the post ground down, and a square key in the center, but with a custom chip for the driver).

Unlike the VEX controller code to motors, there is no constant pulse going to the signal pins, just for the brief moment you digitalwrite to the pin, or servowrite to the pin.. Once you finish that instruction, the servo would stop anyways, because you are no-longer sending the pulses to it. just a dead GND signal. Same goes with the Basic Stamp, once you write the pulsout, there is no constant signal.. the delay, just gives the code time to stop, while the servo performs the movement, then waits for the next pulse. (with the VEX, if you wrote out to the motors, the 2nd PIC inside would maintain the pulses, until you told it to stop, which lead to a lot of run-away problems if the code crashed.)

gelfling6: Unlike the VEX controller code to motors, there is no constant pulse going to the signal pins, just for the brief moment you digitalwrite to the pin, or servowrite to the pin.. Once you finish that instruction, the servo would stop anyways, because you are no-longer sending the pulses to it. just a dead GND signal. Same goes with the Basic Stamp, once you write the pulsout, there is no constant signal.. the delay, just gives the code time to stop, while the servo performs the movement, then waits for the next pulse. (with the VEX, if you wrote out to the motors, the 2nd PIC inside would maintain the pulses, until you told it to stop, which lead to a lot of run-away problems if the code crashed.)

The Arduino Servo library is constantly sending pulses to the servos (every 20ms) without requiring any attention from the sketch. You only need to write a new values when you want to change the angle, or as in this application, speed.