Search wiring.org.co:

Reference for Wiring version 0024+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

Class | Stepper
Name | ### setSpeed()
Examples |
    #include "Stepper.h"

    // change the steps variable to the number of steps on your motor
    int steps = 100;

    // create and attaches a stepper motor
    // with 100 steps to pins 0, 1, 2 and 3

    Stepper stepper(steps, 0, 1, 2, 3);

    void setup()
    {
      // set the speed of the motor to 20 rpms
      stepper.setSpeed(20);
    }

    void loop()
    {
      // move 20 steps forward
      stepper.step(20);

      // move 20 steps backwards
      stepper.step(-20);
    }
Description | The setSpeed(rpm) method sets the speed of the stepper motor to the rpm (revolutions per minute) specified.
Syntax |
    stepper.setSpeed(rpm)
Parameters |
stepper | Any variable of type Stepper
rpm | Any integer value
Returns | None
Usage | Application

Updated on November 01, 2009 09:10:30am PST