From 705c35d513d8cc0fcd09bd5e86a82970cb0979a2 Mon Sep 17 00:00:00 2001 From: Agis Zisimatos Date: Mon, 3 Aug 2015 17:29:26 +0300 Subject: [PATCH] Add AccelStepper library and update README file. --- Arduino/README.md | 2 +- .../libraries/AccelStepper/AccelStepper.cpp | 633 ++++++++ Arduino/libraries/AccelStepper/AccelStepper.h | 666 ++++++++ Arduino/libraries/AccelStepper/LICENSE | 17 + Arduino/libraries/AccelStepper/MANIFEST | 35 + Arduino/libraries/AccelStepper/Makefile | 30 + .../doc/AccelStepper_8h-source.html | 420 +++++ .../libraries/AccelStepper/doc/annotated.html | 62 + .../doc/classAccelStepper-members.html | 105 ++ .../AccelStepper/doc/classAccelStepper.html | 1251 +++++++++++++++ .../libraries/AccelStepper/doc/doxygen.css | 1357 +++++++++++++++++ .../libraries/AccelStepper/doc/doxygen.png | Bin 0 -> 3779 bytes Arduino/libraries/AccelStepper/doc/files.html | 61 + .../libraries/AccelStepper/doc/functions.html | 244 +++ .../AccelStepper/doc/functions_func.html | 201 +++ Arduino/libraries/AccelStepper/doc/index.html | 184 +++ Arduino/libraries/AccelStepper/doc/tab_b.gif | Bin 0 -> 35 bytes Arduino/libraries/AccelStepper/doc/tab_l.gif | Bin 0 -> 706 bytes Arduino/libraries/AccelStepper/doc/tab_r.gif | Bin 0 -> 2585 bytes Arduino/libraries/AccelStepper/doc/tabs.css | 60 + .../AFMotor_ConstantSpeed.pde | 36 + .../AFMotor_MultiStepper.pde | 54 + .../examples/Blocking/Blocking.pde | 28 + .../AccelStepper/examples/Bounce/Bounce.pde | 29 + .../examples/ConstantSpeed/ConstantSpeed.pde | 23 + .../DualMotorShield/DualMotorShield.pde | 49 + .../examples/MotorShield/MotorShield.pde | 103 ++ .../examples/MultiStepper/MultiStepper.pde | 41 + .../examples/Overshoot/Overshoot.pde | 28 + .../ProportionalControl.pde | 32 + .../examples/Quickstop/Quickstop.pde | 40 + .../AccelStepper/examples/Random/Random.pde | 30 + Arduino/libraries/AccelStepper/keywords.txt | 40 + Arduino/libraries/AccelStepper/project.cfg | 290 ++++ 34 files changed, 6150 insertions(+), 1 deletion(-) create mode 100644 Arduino/libraries/AccelStepper/AccelStepper.cpp create mode 100644 Arduino/libraries/AccelStepper/AccelStepper.h create mode 100644 Arduino/libraries/AccelStepper/LICENSE create mode 100644 Arduino/libraries/AccelStepper/MANIFEST create mode 100644 Arduino/libraries/AccelStepper/Makefile create mode 100644 Arduino/libraries/AccelStepper/doc/AccelStepper_8h-source.html create mode 100644 Arduino/libraries/AccelStepper/doc/annotated.html create mode 100644 Arduino/libraries/AccelStepper/doc/classAccelStepper-members.html create mode 100644 Arduino/libraries/AccelStepper/doc/classAccelStepper.html create mode 100644 Arduino/libraries/AccelStepper/doc/doxygen.css create mode 100644 Arduino/libraries/AccelStepper/doc/doxygen.png create mode 100644 Arduino/libraries/AccelStepper/doc/files.html create mode 100644 Arduino/libraries/AccelStepper/doc/functions.html create mode 100644 Arduino/libraries/AccelStepper/doc/functions_func.html create mode 100644 Arduino/libraries/AccelStepper/doc/index.html create mode 100644 Arduino/libraries/AccelStepper/doc/tab_b.gif create mode 100644 Arduino/libraries/AccelStepper/doc/tab_l.gif create mode 100644 Arduino/libraries/AccelStepper/doc/tab_r.gif create mode 100644 Arduino/libraries/AccelStepper/doc/tabs.css create mode 100644 Arduino/libraries/AccelStepper/examples/AFMotor_ConstantSpeed/AFMotor_ConstantSpeed.pde create mode 100644 Arduino/libraries/AccelStepper/examples/AFMotor_MultiStepper/AFMotor_MultiStepper.pde create mode 100644 Arduino/libraries/AccelStepper/examples/Blocking/Blocking.pde create mode 100644 Arduino/libraries/AccelStepper/examples/Bounce/Bounce.pde create mode 100644 Arduino/libraries/AccelStepper/examples/ConstantSpeed/ConstantSpeed.pde create mode 100644 Arduino/libraries/AccelStepper/examples/DualMotorShield/DualMotorShield.pde create mode 100644 Arduino/libraries/AccelStepper/examples/MotorShield/MotorShield.pde create mode 100644 Arduino/libraries/AccelStepper/examples/MultiStepper/MultiStepper.pde create mode 100644 Arduino/libraries/AccelStepper/examples/Overshoot/Overshoot.pde create mode 100644 Arduino/libraries/AccelStepper/examples/ProportionalControl/ProportionalControl.pde create mode 100644 Arduino/libraries/AccelStepper/examples/Quickstop/Quickstop.pde create mode 100644 Arduino/libraries/AccelStepper/examples/Random/Random.pde create mode 100644 Arduino/libraries/AccelStepper/keywords.txt create mode 100644 Arduino/libraries/AccelStepper/project.cfg diff --git a/Arduino/README.md b/Arduino/README.md index 516c01f..47fbcf4 100644 --- a/Arduino/README.md +++ b/Arduino/README.md @@ -1,4 +1,4 @@ Arduino Code ============ -In order to use this code, you need to download and install the [AccelStepper library](http://www.airspayce.com/mikem/arduino/AccelStepper/). \ No newline at end of file +In order to use this code, you need to put the AccelStepper v1.46 library in your libraries folder. Thanks to [AccelStepper library](http://www.airspayce.com/mikem/arduino/AccelStepper/). \ No newline at end of file diff --git a/Arduino/libraries/AccelStepper/AccelStepper.cpp b/Arduino/libraries/AccelStepper/AccelStepper.cpp new file mode 100644 index 0000000..29e6469 --- /dev/null +++ b/Arduino/libraries/AccelStepper/AccelStepper.cpp @@ -0,0 +1,633 @@ +// AccelStepper.cpp +// +// Copyright (C) 2009-2013 Mike McCauley +// $Id: AccelStepper.cpp,v 1.19 2014/10/31 06:05:27 mikem Exp mikem $ + +#include "AccelStepper.h" + +#if 0 +// Some debugging assistance +void dump(uint8_t* p, int l) +{ + int i; + + for (i = 0; i < l; i++) + { + Serial.print(p[i], HEX); + Serial.print(" "); + } + Serial.println(""); +} +#endif + +void AccelStepper::moveTo(long absolute) +{ + if (_targetPos != absolute) + { + _targetPos = absolute; + computeNewSpeed(); + // compute new n? + } +} + +void AccelStepper::move(long relative) +{ + moveTo(_currentPos + relative); +} + +// Implements steps according to the current step interval +// You must call this at least once per step +// returns true if a step occurred +boolean AccelStepper::runSpeed() +{ + // Dont do anything unless we actually have a step interval + if (!_stepInterval) + return false; + + unsigned long time = micros(); + unsigned long nextStepTime = _lastStepTime + _stepInterval; + // Gymnastics to detect wrapping of either the nextStepTime and/or the current time + if ( ((nextStepTime >= _lastStepTime) && ((time >= nextStepTime) || (time < _lastStepTime))) + || ((nextStepTime < _lastStepTime) && ((time >= nextStepTime) && (time < _lastStepTime)))) + { + if (_direction == DIRECTION_CW) + { + // Clockwise + _currentPos += 1; + } + else + { + // Anticlockwise + _currentPos -= 1; + } + step(_currentPos); + + _lastStepTime = time; + return true; + } + else + { + return false; + } +} + +long AccelStepper::distanceToGo() +{ + return _targetPos - _currentPos; +} + +long AccelStepper::targetPosition() +{ + return _targetPos; +} + +long AccelStepper::currentPosition() +{ + return _currentPos; +} + +// Useful during initialisations or after initial positioning +// Sets speed to 0 +void AccelStepper::setCurrentPosition(long position) +{ + _targetPos = _currentPos = position; + _n = 0; + _stepInterval = 0; +} + +void AccelStepper::computeNewSpeed() +{ + long distanceTo = distanceToGo(); // +ve is clockwise from curent location + + long stepsToStop = (long)((_speed * _speed) / (2.0 * _acceleration)); // Equation 16 + + if (distanceTo == 0 && stepsToStop <= 1) + { + // We are at the target and its time to stop + _stepInterval = 0; + _speed = 0.0; + _n = 0; + return; + } + + if (distanceTo > 0) + { + // We are anticlockwise from the target + // Need to go clockwise from here, maybe decelerate now + if (_n > 0) + { + // Currently accelerating, need to decel now? Or maybe going the wrong way? + if ((stepsToStop >= distanceTo) || _direction == DIRECTION_CCW) + _n = -stepsToStop; // Start deceleration + } + else if (_n < 0) + { + // Currently decelerating, need to accel again? + if ((stepsToStop < distanceTo) && _direction == DIRECTION_CW) + _n = -_n; // Start accceleration + } + } + else if (distanceTo < 0) + { + // We are clockwise from the target + // Need to go anticlockwise from here, maybe decelerate + if (_n > 0) + { + // Currently accelerating, need to decel now? Or maybe going the wrong way? + if ((stepsToStop >= -distanceTo) || _direction == DIRECTION_CW) + _n = -stepsToStop; // Start deceleration + } + else if (_n < 0) + { + // Currently decelerating, need to accel again? + if ((stepsToStop < -distanceTo) && _direction == DIRECTION_CCW) + _n = -_n; // Start accceleration + } + } + + // Need to accelerate or decelerate + if (_n == 0) + { + // First step from stopped + _cn = _c0; + _direction = (distanceTo > 0) ? DIRECTION_CW : DIRECTION_CCW; + } + else + { + // Subsequent step. Works for accel (n is +_ve) and decel (n is -ve). + _cn = _cn - ((2.0 * _cn) / ((4.0 * _n) + 1)); // Equation 13 + _cn = max(_cn, _cmin); + } + _n++; + _stepInterval = _cn; + _speed = 1000000.0 / _cn; + if (_direction == DIRECTION_CCW) + _speed = -_speed; + +#if 0 + Serial.println(_speed); + Serial.println(_acceleration); + Serial.println(_cn); + Serial.println(_c0); + Serial.println(_n); + Serial.println(_stepInterval); + Serial.println(distanceTo); + Serial.println(stepsToStop); + Serial.println("-----"); +#endif +} + +// Run the motor to implement speed and acceleration in order to proceed to the target position +// You must call this at least once per step, preferably in your main loop +// If the motor is in the desired position, the cost is very small +// returns true if the motor is still running to the target position. +boolean AccelStepper::run() +{ + if (runSpeed()) + computeNewSpeed(); + return _speed != 0.0 || distanceToGo() != 0; +} + +AccelStepper::AccelStepper(uint8_t interface, uint8_t pin1, uint8_t pin2, uint8_t pin3, uint8_t pin4, bool enable) +{ + _interface = interface; + _currentPos = 0; + _targetPos = 0; + _speed = 0.0; + _maxSpeed = 1.0; + _acceleration = 0.0; + _sqrt_twoa = 1.0; + _stepInterval = 0; + _minPulseWidth = 1; + _enablePin = 0xff; + _lastStepTime = 0; + _pin[0] = pin1; + _pin[1] = pin2; + _pin[2] = pin3; + _pin[3] = pin4; + + // NEW + _n = 0; + _c0 = 0.0; + _cn = 0.0; + _cmin = 1.0; + _direction = DIRECTION_CCW; + + int i; + for (i = 0; i < 4; i++) + _pinInverted[i] = 0; + if (enable) + enableOutputs(); + // Some reasonable default + setAcceleration(1); +} + +AccelStepper::AccelStepper(void (*forward)(), void (*backward)()) +{ + _interface = 0; + _currentPos = 0; + _targetPos = 0; + _speed = 0.0; + _maxSpeed = 1.0; + _acceleration = 0.0; + _sqrt_twoa = 1.0; + _stepInterval = 0; + _minPulseWidth = 1; + _enablePin = 0xff; + _lastStepTime = 0; + _pin[0] = 0; + _pin[1] = 0; + _pin[2] = 0; + _pin[3] = 0; + _forward = forward; + _backward = backward; + + // NEW + _n = 0; + _c0 = 0.0; + _cn = 0.0; + _cmin = 1.0; + _direction = DIRECTION_CCW; + + int i; + for (i = 0; i < 4; i++) + _pinInverted[i] = 0; + // Some reasonable default + setAcceleration(1); +} + +void AccelStepper::setMaxSpeed(float speed) +{ + if (_maxSpeed != speed) + { + _maxSpeed = speed; + _cmin = 1000000.0 / speed; + // Recompute _n from current speed and adjust speed if accelerating or cruising + if (_n > 0) + { + _n = (long)((_speed * _speed) / (2.0 * _acceleration)); // Equation 16 + computeNewSpeed(); + } + } +} + +void AccelStepper::setAcceleration(float acceleration) +{ + if (acceleration == 0.0) + return; + if (_acceleration != acceleration) + { + // Recompute _n per Equation 17 + _n = _n * (_acceleration / acceleration); + // New c0 per Equation 7, with correction per Equation 15 + _c0 = 0.676 * sqrt(2.0 / acceleration) * 1000000.0; // Equation 15 + _acceleration = acceleration; + computeNewSpeed(); + } +} + +void AccelStepper::setSpeed(float speed) +{ + if (speed == _speed) + return; + speed = constrain(speed, -_maxSpeed, _maxSpeed); + if (speed == 0.0) + _stepInterval = 0; + else + { + _stepInterval = fabs(1000000.0 / speed); + _direction = (speed > 0.0) ? DIRECTION_CW : DIRECTION_CCW; + } + _speed = speed; +} + +float AccelStepper::speed() +{ + return _speed; +} + +// Subclasses can override +void AccelStepper::step(long step) +{ + switch (_interface) + { + case FUNCTION: + step0(step); + break; + + case DRIVER: + step1(step); + break; + + case FULL2WIRE: + step2(step); + break; + + case FULL3WIRE: + step3(step); + break; + + case FULL4WIRE: + step4(step); + break; + + case HALF3WIRE: + step6(step); + break; + + case HALF4WIRE: + step8(step); + break; + } +} + +// You might want to override this to implement eg serial output +// bit 0 of the mask corresponds to _pin[0] +// bit 1 of the mask corresponds to _pin[1] +// .... +void AccelStepper::setOutputPins(uint8_t mask) +{ + uint8_t numpins = 2; + if (_interface == FULL4WIRE || _interface == HALF4WIRE) + numpins = 4; + else if (_interface == FULL3WIRE || _interface == HALF3WIRE) + numpins = 3; + uint8_t i; + for (i = 0; i < numpins; i++) + digitalWrite(_pin[i], (mask & (1 << i)) ? (HIGH ^ _pinInverted[i]) : (LOW ^ _pinInverted[i])); +} + +// 0 pin step function (ie for functional usage) +void AccelStepper::step0(long step) +{ + if (_speed > 0) + _forward(); + else + _backward(); +} + +// 1 pin step function (ie for stepper drivers) +// This is passed the current step number (0 to 7) +// Subclasses can override +void AccelStepper::step1(long step) +{ + // _pin[0] is step, _pin[1] is direction + setOutputPins(_direction ? 0b10 : 0b00); // Set direction first else get rogue pulses + setOutputPins(_direction ? 0b11 : 0b01); // step HIGH + // Caution 200ns setup time + // Delay the minimum allowed pulse width + delayMicroseconds(_minPulseWidth); + setOutputPins(_direction ? 0b10 : 0b00); // step LOW + +} + + +// 2 pin step function +// This is passed the current step number (0 to 7) +// Subclasses can override +void AccelStepper::step2(long step) +{ + switch (step & 0x3) + { + case 0: /* 01 */ + setOutputPins(0b10); + break; + + case 1: /* 11 */ + setOutputPins(0b11); + break; + + case 2: /* 10 */ + setOutputPins(0b01); + break; + + case 3: /* 00 */ + setOutputPins(0b00); + break; + } +} +// 3 pin step function +// This is passed the current step number (0 to 7) +// Subclasses can override +void AccelStepper::step3(long step) +{ + switch (step % 3) + { + case 0: // 100 + setOutputPins(0b100); + break; + + case 1: // 001 + setOutputPins(0b001); + break; + + case 2: //010 + setOutputPins(0b010); + break; + + } +} + +// 4 pin step function for half stepper +// This is passed the current step number (0 to 7) +// Subclasses can override +void AccelStepper::step4(long step) +{ + switch (step & 0x3) + { + case 0: // 1010 + setOutputPins(0b0101); + break; + + case 1: // 0110 + setOutputPins(0b0110); + break; + + case 2: //0101 + setOutputPins(0b1010); + break; + + case 3: //1001 + setOutputPins(0b1001); + break; + } +} + +// 3 pin half step function +// This is passed the current step number (0 to 7) +// Subclasses can override +void AccelStepper::step6(long step) +{ + switch (step % 6) + { + case 0: // 100 + setOutputPins(0b100); + break; + + case 1: // 101 + setOutputPins(0b101); + break; + + case 2: // 001 + setOutputPins(0b001); + break; + + case 3: // 011 + setOutputPins(0b011); + break; + + case 4: // 010 + setOutputPins(0b010); + break; + + case 5: // 011 + setOutputPins(0b110); + break; + + } +} + +// 4 pin half step function +// This is passed the current step number (0 to 7) +// Subclasses can override +void AccelStepper::step8(long step) +{ + switch (step & 0x7) + { + case 0: // 1000 + setOutputPins(0b0001); + break; + + case 1: // 1010 + setOutputPins(0b0101); + break; + + case 2: // 0010 + setOutputPins(0b0100); + break; + + case 3: // 0110 + setOutputPins(0b0110); + break; + + case 4: // 0100 + setOutputPins(0b0010); + break; + + case 5: //0101 + setOutputPins(0b1010); + break; + + case 6: // 0001 + setOutputPins(0b1000); + break; + + case 7: //1001 + setOutputPins(0b1001); + break; + } +} + +// Prevents power consumption on the outputs +void AccelStepper::disableOutputs() +{ + if (! _interface) return; + + setOutputPins(0); // Handles inversion automatically + if (_enablePin != 0xff) + digitalWrite(_enablePin, LOW ^ _enableInverted); +} + +void AccelStepper::enableOutputs() +{ + if (! _interface) + return; + + pinMode(_pin[0], OUTPUT); + pinMode(_pin[1], OUTPUT); + if (_interface == FULL4WIRE || _interface == HALF4WIRE) + { + pinMode(_pin[2], OUTPUT); + pinMode(_pin[3], OUTPUT); + } + else if (_interface == FULL3WIRE || _interface == HALF3WIRE) + { + pinMode(_pin[2], OUTPUT); + } + + if (_enablePin != 0xff) + { + pinMode(_enablePin, OUTPUT); + digitalWrite(_enablePin, HIGH ^ _enableInverted); + } +} + +void AccelStepper::setMinPulseWidth(unsigned int minWidth) +{ + _minPulseWidth = minWidth; +} + +void AccelStepper::setEnablePin(uint8_t enablePin) +{ + _enablePin = enablePin; + + // This happens after construction, so init pin now. + if (_enablePin != 0xff) + { + pinMode(_enablePin, OUTPUT); + digitalWrite(_enablePin, HIGH ^ _enableInverted); + } +} + +void AccelStepper::setPinsInverted(bool directionInvert, bool stepInvert, bool enableInvert) +{ + _pinInverted[0] = stepInvert; + _pinInverted[1] = directionInvert; + _enableInverted = enableInvert; +} + +void AccelStepper::setPinsInverted(bool pin1Invert, bool pin2Invert, bool pin3Invert, bool pin4Invert, bool enableInvert) +{ + _pinInverted[0] = pin1Invert; + _pinInverted[1] = pin2Invert; + _pinInverted[2] = pin3Invert; + _pinInverted[3] = pin4Invert; + _enableInverted = enableInvert; +} + +// Blocks until the target position is reached and stopped +void AccelStepper::runToPosition() +{ + while (run()) + ; +} + +boolean AccelStepper::runSpeedToPosition() +{ + if (_targetPos == _currentPos) + return false; + if (_targetPos >_currentPos) + _direction = DIRECTION_CW; + else + _direction = DIRECTION_CCW; + return runSpeed(); +} + +// Blocks until the new target position is reached +void AccelStepper::runToNewPosition(long position) +{ + moveTo(position); + runToPosition(); +} + +void AccelStepper::stop() +{ + if (_speed != 0.0) + { + long stepsToStop = (long)((_speed * _speed) / (2.0 * _acceleration)) + 1; // Equation 16 (+integer rounding) + if (_speed > 0) + move(stepsToStop); + else + move(-stepsToStop); + } +} diff --git a/Arduino/libraries/AccelStepper/AccelStepper.h b/Arduino/libraries/AccelStepper/AccelStepper.h new file mode 100644 index 0000000..26f9436 --- /dev/null +++ b/Arduino/libraries/AccelStepper/AccelStepper.h @@ -0,0 +1,666 @@ +// AccelStepper.h +// +/// \mainpage AccelStepper library for Arduino +/// +/// This is the Arduino AccelStepper library. +/// It provides an object-oriented interface for 2, 3 or 4 pin stepper motors. +/// +/// The standard Arduino IDE includes the Stepper library +/// (http://arduino.cc/en/Reference/Stepper) for stepper motors. It is +/// perfectly adequate for simple, single motor applications. +/// +/// AccelStepper significantly improves on the standard Arduino Stepper library in several ways: +/// \li Supports acceleration and deceleration +/// \li Supports multiple simultaneous steppers, with independent concurrent stepping on each stepper +/// \li API functions never delay() or block +/// \li Supports 2, 3 and 4 wire steppers, plus 3 and 4 wire half steppers. +/// \li Supports alternate stepping functions to enable support of AFMotor (https://github.com/adafruit/Adafruit-Motor-Shield-library) +/// \li Supports stepper drivers such as the Sparkfun EasyDriver (based on 3967 driver chip) +/// \li Very slow speeds are supported +/// \li Extensive API +/// \li Subclass support +/// +/// The latest version of this documentation can be downloaded from +/// http://www.airspayce.com/mikem/arduino/AccelStepper +/// The version of the package that this documentation refers to can be downloaded +/// from http://www.airspayce.com/mikem/arduino/AccelStepper/AccelStepper-1.47.zip +/// +/// Example Arduino programs are included to show the main modes of use. +/// +/// You can also find online help and discussion at http://groups.google.com/group/accelstepper +/// Please use that group for all questions and discussions on this topic. +/// Do not contact the author directly, unless it is to discuss commercial licensing. +/// Before asking a question or reporting a bug, please read http://www.catb.org/esr/faqs/smart-questions.html +/// +/// Tested on Arduino Diecimila and Mega with arduino-0018 & arduino-0021 +/// on OpenSuSE 11.1 and avr-libc-1.6.1-1.15, +/// cross-avr-binutils-2.19-9.1, cross-avr-gcc-4.1.3_20080612-26.5. +/// Tested on Teensy http://www.pjrc.com/teensy including Teensy 3.1 built using Arduino IDE 1.0.5 with +/// teensyduino addon 1.18 and later. +/// +/// \par Installation +/// +/// Install in the usual way: unzip the distribution zip file to the libraries +/// sub-folder of your sketchbook. +/// +/// \par Theory +/// +/// This code uses speed calculations as described in +/// "Generate stepper-motor speed profiles in real time" by David Austin +/// http://fab.cba.mit.edu/classes/MIT/961.09/projects/i0/Stepper_Motor_Speed_Profile.pdf +/// with the exception that AccelStepper uses steps per second rather than radians per second +/// (because we dont know the step angle of the motor) +/// An initial step interval is calculated for the first step, based on the desired acceleration +/// On subsequent steps, shorter step intervals are calculated based +/// on the previous step until max speed is achieved. +/// +/// \par Donations +/// +/// This library is offered under a free GPL license for those who want to use it that way. +/// We try hard to keep it up to date, fix bugs +/// and to provide free support. If this library has helped you save time or money, please consider donating at +/// http://www.airspayce.com or here: +/// +/// \htmlonly
\endhtmlonly +/// +/// \par Trademarks +/// +/// AccelStepper is a trademark of AirSpayce Pty Ltd. The AccelStepper mark was first used on April 26 2010 for +/// international trade, and is used only in relation to motor control hardware and software. +/// It is not to be confused with any other similar marks covering other goods and services. +/// +/// \par Copyright +/// +/// This software is Copyright (C) 2010 Mike McCauley. Use is subject to license +/// conditions. The main licensing options available are GPL V2 or Commercial: +/// +/// \par Open Source Licensing GPL V2 +/// This is the appropriate option if you want to share the source code of your +/// application with everyone you distribute it to, and you also want to give them +/// the right to share who uses it. If you wish to use this software under Open +/// Source Licensing, you must contribute all your source code to the open source +/// community in accordance with the GPL Version 2 when your application is +/// distributed. See http://www.gnu.org/copyleft/gpl.html +/// +/// \par Commercial Licensing +/// This is the appropriate option if you are creating proprietary applications +/// and you are not prepared to distribute and share the source code of your +/// application. Contact info@airspayce.com for details. +/// +/// \par Revision History +/// \version 1.0 Initial release +/// +/// \version 1.1 Added speed() function to get the current speed. +/// \version 1.2 Added runSpeedToPosition() submitted by Gunnar Arndt. +/// \version 1.3 Added support for stepper drivers (ie with Step and Direction inputs) with _pins == 1 +/// \version 1.4 Added functional contructor to support AFMotor, contributed by Limor, with example sketches. +/// \version 1.5 Improvements contributed by Peter Mousley: Use of microsecond steps and other speed improvements +/// to increase max stepping speed to about 4kHz. New option for user to set the min allowed pulse width. +/// Added checks for already running at max speed and skip further calcs if so. +/// \version 1.6 Fixed a problem with wrapping of microsecond stepping that could cause stepping to hang. +/// Reported by Sandy Noble. +/// Removed redundant _lastRunTime member. +/// \version 1.7 Fixed a bug where setCurrentPosition() did not always work as expected. +/// Reported by Peter Linhart. +/// \version 1.8 Added support for 4 pin half-steppers, requested by Harvey Moon +/// \version 1.9 setCurrentPosition() now also sets motor speed to 0. +/// \version 1.10 Builds on Arduino 1.0 +/// \version 1.11 Improvments from Michael Ellison: +/// Added optional enable line support for stepper drivers +/// Added inversion for step/direction/enable lines for stepper drivers +/// \version 1.12 Announce Google Group +/// \version 1.13 Improvements to speed calculation. Cost of calculation is now less in the worst case, +/// and more or less constant in all cases. This should result in slightly beter high speed performance, and +/// reduce anomalous speed glitches when other steppers are accelerating. +/// However, its hard to see how to replace the sqrt() required at the very first step from 0 speed. +/// \version 1.14 Fixed a problem with compiling under arduino 0021 reported by EmbeddedMan +/// \version 1.15 Fixed a problem with runSpeedToPosition which did not correctly handle +/// running backwards to a smaller target position. Added examples +/// \version 1.16 Fixed some cases in the code where abs() was used instead of fabs(). +/// \version 1.17 Added example ProportionalControl +/// \version 1.18 Fixed a problem: If one calls the funcion runSpeed() when Speed is zero, it makes steps +/// without counting. reported by Friedrich, Klappenbach. +/// \version 1.19 Added MotorInterfaceType and symbolic names for the number of pins to use +/// for the motor interface. Updated examples to suit. +/// Replaced individual pin assignment variables _pin1, _pin2 etc with array _pin[4]. +/// _pins member changed to _interface. +/// Added _pinInverted array to simplify pin inversion operations. +/// Added new function setOutputPins() which sets the motor output pins. +/// It can be overridden in order to provide, say, serial output instead of parallel output +/// Some refactoring and code size reduction. +/// \version 1.20 Improved documentation and examples to show need for correctly +/// specifying AccelStepper::FULL4WIRE and friends. +/// \version 1.21 Fixed a problem where desiredSpeed could compute the wrong step acceleration +/// when _speed was small but non-zero. Reported by Brian Schmalz. +/// Precompute sqrt_twoa to improve performance and max possible stepping speed +/// \version 1.22 Added Bounce.pde example +/// Fixed a problem where calling moveTo(), setMaxSpeed(), setAcceleration() more +/// frequently than the step time, even +/// with the same values, would interfere with speed calcs. Now a new speed is computed +/// only if there was a change in the set value. Reported by Brian Schmalz. +/// \version 1.23 Rewrite of the speed algorithms in line with +/// http://fab.cba.mit.edu/classes/MIT/961.09/projects/i0/Stepper_Motor_Speed_Profile.pdf +/// Now expect smoother and more linear accelerations and decelerations. The desiredSpeed() +/// function was removed. +/// \version 1.24 Fixed a problem introduced in 1.23: with runToPosition, which did never returned +/// \version 1.25 Now ignore attempts to set acceleration to 0.0 +/// \version 1.26 Fixed a problem where certina combinations of speed and accelration could cause +/// oscillation about the target position. +/// \version 1.27 Added stop() function to stop as fast as possible with current acceleration parameters. +/// Also added new Quickstop example showing its use. +/// \version 1.28 Fixed another problem where certain combinations of speed and accelration could cause +/// oscillation about the target position. +/// Added support for 3 wire full and half steppers such as Hard Disk Drive spindle. +/// Contributed by Yuri Ivatchkovitch. +/// \version 1.29 Fixed a problem that could cause a DRIVER stepper to continually step +/// with some sketches. Reported by Vadim. +/// \version 1.30 Fixed a problem that could cause stepper to back up a few steps at the end of +/// accelerated travel with certain speeds. Reported and patched by jolo. +/// \version 1.31 Updated author and distribution location details to airspayce.com +/// \version 1.32 Fixed a problem with enableOutputs() and setEnablePin on Arduino Due that +/// prevented the enable pin changing stae correctly. Reported by Duane Bishop. +/// \version 1.33 Fixed an error in example AFMotor_ConstantSpeed.pde did not setMaxSpeed(); +/// Fixed a problem that caused incorrect pin sequencing of FULL3WIRE and HALF3WIRE. +/// Unfortunately this meant changing the signature for all step*() functions. +/// Added example MotorShield, showing how to use AdaFruit Motor Shield to control +/// a 3 phase motor such as a HDD spindle motor (and without using the AFMotor library. +/// \version 1.34 Added setPinsInverted(bool pin1Invert, bool pin2Invert, bool pin3Invert, bool pin4Invert, bool enableInvert) +/// to allow inversion of 2, 3 and 4 wire stepper pins. Requested by Oleg. +/// \version 1.35 Removed default args from setPinsInverted(bool, bool, bool, bool, bool) to prevent ambiguity with +/// setPinsInverted(bool, bool, bool). Reported by Mac Mac. +/// \version 1.36 Changed enableOutputs() and disableOutputs() to be virtual so can be overridden. +/// Added new optional argument 'enable' to constructor, which allows you toi disable the +/// automatic enabling of outputs at construction time. Suggested by Guido. +/// \version 1.37 Fixed a problem with step1 that could cause a rogue step in the +/// wrong direction (or not, +/// depending on the setup-time requirements of the connected hardware). +/// Reported by Mark Tillotson. +/// \version 1.38 run() function incorrectly always returned true. Updated function and doc so it returns true +/// if the motor is still running to the target position. +/// \version 1.39 Updated typos in keywords.txt, courtesey Jon Magill. +/// \version 1.40 Updated documentation, including testing on Teensy 3.1 +/// \version 1.41 Fixed an error in the acceleration calculations, resulting in acceleration of haldf the intended value +/// \version 1.42 Improved support for FULL3WIRE and HALF3WIRE output pins. These changes were in Yuri's original +/// contribution but did not make it into production.
+/// \version 1.43 Added DualMotorShield example. Shows how to use AccelStepper to control 2 x 2 phase steppers using the +/// Itead Studio Arduino Dual Stepper Motor Driver Shield model IM120417015.
+/// \version 1.44 examples/DualMotorShield/DualMotorShield.ino examples/DualMotorShield/DualMotorShield.pde +/// was missing from the distribution.
+/// \version 1.45 Fixed a problem where if setAcceleration was not called, there was no default +/// acceleration. Reported by Michael Newman.
+/// \version 1.45 Fixed inaccuracy in acceleration rate by using Equation 15, suggested by Sebastian Gracki.
+/// Performance improvements in runSpeed suggested by Jaakko Fagerlund.
+/// \version 1.46 Fixed error in documentation for runToPosition(). +/// Reinstated time calculations in runSpeed() since new version is reported +/// not to work correctly under some circumstances. Reported by Oleg V Gavva.
+ +/// +/// \author Mike McCauley (mikem@airspayce.com) DO NOT CONTACT THE AUTHOR DIRECTLY: USE THE LISTS +// Copyright (C) 2009-2013 Mike McCauley +// $Id: AccelStepper.h,v 1.21 2014/10/31 06:05:30 mikem Exp mikem $ + +#ifndef AccelStepper_h +#define AccelStepper_h + +#include +#if ARDUINO >= 100 +#include +#else +#include +#include +#endif + +// These defs cause trouble on some versions of Arduino +#undef round + +///////////////////////////////////////////////////////////////////// +/// \class AccelStepper AccelStepper.h +/// \brief Support for stepper motors with acceleration etc. +/// +/// This defines a single 2 or 4 pin stepper motor, or stepper moter with fdriver chip, with optional +/// acceleration, deceleration, absolute positioning commands etc. Multiple +/// simultaneous steppers are supported, all moving +/// at different speeds and accelerations. +/// +/// \par Operation +/// This module operates by computing a step time in microseconds. The step +/// time is recomputed after each step and after speed and acceleration +/// parameters are changed by the caller. The time of each step is recorded in +/// microseconds. The run() function steps the motor once if a new step is due. +/// The run() function must be called frequently until the motor is in the +/// desired position, after which time run() will do nothing. +/// +/// \par Positioning +/// Positions are specified by a signed long integer. At +/// construction time, the current position of the motor is consider to be 0. Positive +/// positions are clockwise from the initial position; negative positions are +/// anticlockwise. The current position can be altered for instance after +/// initialization positioning. +/// +/// \par Caveats +/// This is an open loop controller: If the motor stalls or is oversped, +/// AccelStepper will not have a correct +/// idea of where the motor really is (since there is no feedback of the motor's +/// real position. We only know where we _think_ it is, relative to the +/// initial starting point). +/// +/// \par Performance +/// The fastest motor speed that can be reliably supported is about 4000 steps per +/// second at a clock frequency of 16 MHz on Arduino such as Uno etc. +/// Faster processors can support faster stepping speeds. +/// However, any speed less than that +/// down to very slow speeds (much less than one per second) are also supported, +/// provided the run() function is called frequently enough to step the motor +/// whenever required for the speed set. +/// Calling setAcceleration() is expensive, +/// since it requires a square root to be calculated. +class AccelStepper +{ +public: + /// \brief Symbolic names for number of pins. + /// Use this in the pins argument the AccelStepper constructor to + /// provide a symbolic name for the number of pins + /// to use. + typedef enum + { + FUNCTION = 0, ///< Use the functional interface, implementing your own driver functions (internal use only) + DRIVER = 1, ///< Stepper Driver, 2 driver pins required + FULL2WIRE = 2, ///< 2 wire stepper, 2 motor pins required + FULL3WIRE = 3, ///< 3 wire stepper, such as HDD spindle, 3 motor pins required + FULL4WIRE = 4, ///< 4 wire full stepper, 4 motor pins required + HALF3WIRE = 6, ///< 3 wire half stepper, such as HDD spindle, 3 motor pins required + HALF4WIRE = 8 ///< 4 wire half stepper, 4 motor pins required + } MotorInterfaceType; + + /// Constructor. You can have multiple simultaneous steppers, all moving + /// at different speeds and accelerations, provided you call their run() + /// functions at frequent enough intervals. Current Position is set to 0, target + /// position is set to 0. MaxSpeed and Acceleration default to 1.0. + /// The motor pins will be initialised to OUTPUT mode during the + /// constructor by a call to enableOutputs(). + /// \param[in] interface Number of pins to interface to. 1, 2, 4 or 8 are + /// supported, but it is preferred to use the \ref MotorInterfaceType symbolic names. + /// AccelStepper::DRIVER (1) means a stepper driver (with Step and Direction pins). + /// If an enable line is also needed, call setEnablePin() after construction. + /// You may also invert the pins using setPinsInverted(). + /// AccelStepper::FULL2WIRE (2) means a 2 wire stepper (2 pins required). + /// AccelStepper::FULL3WIRE (3) means a 3 wire stepper, such as HDD spindle (3 pins required). + /// AccelStepper::FULL4WIRE (4) means a 4 wire stepper (4 pins required). + /// AccelStepper::HALF3WIRE (6) means a 3 wire half stepper, such as HDD spindle (3 pins required) + /// AccelStepper::HALF4WIRE (8) means a 4 wire half stepper (4 pins required) + /// Defaults to AccelStepper::FULL4WIRE (4) pins. + /// \param[in] pin1 Arduino digital pin number for motor pin 1. Defaults + /// to pin 2. For a AccelStepper::DRIVER (interface==1), + /// this is the Step input to the driver. Low to high transition means to step) + /// \param[in] pin2 Arduino digital pin number for motor pin 2. Defaults + /// to pin 3. For a AccelStepper::DRIVER (interface==1), + /// this is the Direction input the driver. High means forward. + /// \param[in] pin3 Arduino digital pin number for motor pin 3. Defaults + /// to pin 4. + /// \param[in] pin4 Arduino digital pin number for motor pin 4. Defaults + /// to pin 5. + /// \param[in] enable If this is true (the default), enableOutputs() will be called to enable + /// the output pins at construction time. + AccelStepper(uint8_t interface = AccelStepper::FULL4WIRE, uint8_t pin1 = 2, uint8_t pin2 = 3, uint8_t pin3 = 4, uint8_t pin4 = 5, bool enable = true); + + /// Alternate Constructor which will call your own functions for forward and backward steps. + /// You can have multiple simultaneous steppers, all moving + /// at different speeds and accelerations, provided you call their run() + /// functions at frequent enough intervals. Current Position is set to 0, target + /// position is set to 0. MaxSpeed and Acceleration default to 1.0. + /// Any motor initialization should happen before hand, no pins are used or initialized. + /// \param[in] forward void-returning procedure that will make a forward step + /// \param[in] backward void-returning procedure that will make a backward step + AccelStepper(void (*forward)(), void (*backward)()); + + /// Set the target position. The run() function will try to move the motor (at most one step per call) + /// from the current position to the target position set by the most + /// recent call to this function. Caution: moveTo() also recalculates the speed for the next step. + /// If you are trying to use constant speed movements, you should call setSpeed() after calling moveTo(). + /// \param[in] absolute The desired absolute position. Negative is + /// anticlockwise from the 0 position. + void moveTo(long absolute); + + /// Set the target position relative to the current position + /// \param[in] relative The desired position relative to the current position. Negative is + /// anticlockwise from the current position. + void move(long relative); + + /// Poll the motor and step it if a step is due, implementing + /// accelerations and decelerations to acheive the target position. You must call this as + /// frequently as possible, but at least once per minimum step time interval, + /// preferably in your main loop. Note that each call to run() will make at most one step, and then only when a step is due, + /// based on the current speed and the time since the last step. + /// \return true if the motor is still running to the target position. + boolean run(); + + /// Poll the motor and step it if a step is due, implementing a constant + /// speed as set by the most recent call to setSpeed(). You must call this as + /// frequently as possible, but at least once per step interval, + /// \return true if the motor was stepped. + boolean runSpeed(); + + /// Sets the maximum permitted speed. The run() function will accelerate + /// up to the speed set by this function. + /// Caution: the maximum speed achievable depends on your processor and clock speed. + /// \param[in] speed The desired maximum speed in steps per second. Must + /// be > 0. Caution: Speeds that exceed the maximum speed supported by the processor may + /// Result in non-linear accelerations and decelerations. + void setMaxSpeed(float speed); + + /// Sets the acceleration/deceleration rate. + /// \param[in] acceleration The desired acceleration in steps per second + /// per second. Must be > 0.0. This is an expensive call since it requires a square + /// root to be calculated. Dont call more ofthen than needed + void setAcceleration(float acceleration); + + /// Sets the desired constant speed for use with runSpeed(). + /// \param[in] speed The desired constant speed in steps per + /// second. Positive is clockwise. Speeds of more than 1000 steps per + /// second are unreliable. Very slow speeds may be set (eg 0.00027777 for + /// once per hour, approximately. Speed accuracy depends on the Arduino + /// crystal. Jitter depends on how frequently you call the runSpeed() function. + void setSpeed(float speed); + + /// The most recently set speed + /// \return the most recent speed in steps per second + float speed(); + + /// The distance from the current position to the target position. + /// \return the distance from the current position to the target position + /// in steps. Positive is clockwise from the current position. + long distanceToGo(); + + /// The most recently set target position. + /// \return the target position + /// in steps. Positive is clockwise from the 0 position. + long targetPosition(); + + /// The currently motor position. + /// \return the current motor position + /// in steps. Positive is clockwise from the 0 position. + long currentPosition(); + + /// Resets the current position of the motor, so that wherever the motor + /// happens to be right now is considered to be the new 0 position. Useful + /// for setting a zero position on a stepper after an initial hardware + /// positioning move. + /// Has the side effect of setting the current motor speed to 0. + /// \param[in] position The position in steps of wherever the motor + /// happens to be right now. + void setCurrentPosition(long position); + + /// Moves the motor (with acceleration/deceleration) + /// to the target position and blocks until it is at + /// position. Dont use this in event loops, since it blocks. + void runToPosition(); + + /// Runs at the currently selected speed until the target position is reached + /// Does not implement accelerations. + /// \return true if it stepped + boolean runSpeedToPosition(); + + /// Moves the motor (with acceleration/deceleration) + /// to the new target position and blocks until it is at + /// position. Dont use this in event loops, since it blocks. + /// \param[in] position The new target position. + void runToNewPosition(long position); + + /// Sets a new target position that causes the stepper + /// to stop as quickly as possible, using the current speed and acceleration parameters. + void stop(); + + /// Disable motor pin outputs by setting them all LOW + /// Depending on the design of your electronics this may turn off + /// the power to the motor coils, saving power. + /// This is useful to support Arduino low power modes: disable the outputs + /// during sleep and then reenable with enableOutputs() before stepping + /// again. + virtual void disableOutputs(); + + /// Enable motor pin outputs by setting the motor pins to OUTPUT + /// mode. Called automatically by the constructor. + virtual void enableOutputs(); + + /// Sets the minimum pulse width allowed by the stepper driver. The minimum practical pulse width is + /// approximately 20 microseconds. Times less than 20 microseconds + /// will usually result in 20 microseconds or so. + /// \param[in] minWidth The minimum pulse width in microseconds. + void setMinPulseWidth(unsigned int minWidth); + + /// Sets the enable pin number for stepper drivers. + /// 0xFF indicates unused (default). + /// Otherwise, if a pin is set, the pin will be turned on when + /// enableOutputs() is called and switched off when disableOutputs() + /// is called. + /// \param[in] enablePin Arduino digital pin number for motor enable + /// \sa setPinsInverted + void setEnablePin(uint8_t enablePin = 0xff); + + /// Sets the inversion for stepper driver pins + /// \param[in] directionInvert True for inverted direction pin, false for non-inverted + /// \param[in] stepInvert True for inverted step pin, false for non-inverted + /// \param[in] enableInvert True for inverted enable pin, false (default) for non-inverted + void setPinsInverted(bool directionInvert = false, bool stepInvert = false, bool enableInvert = false); + + /// Sets the inversion for 2, 3 and 4 wire stepper pins + /// \param[in] pin1Invert True for inverted pin1, false for non-inverted + /// \param[in] pin2Invert True for inverted pin2, false for non-inverted + /// \param[in] pin3Invert True for inverted pin3, false for non-inverted + /// \param[in] pin4Invert True for inverted pin4, false for non-inverted + /// \param[in] enableInvert True for inverted enable pin, false (default) for non-inverted + void setPinsInverted(bool pin1Invert, bool pin2Invert, bool pin3Invert, bool pin4Invert, bool enableInvert); + +protected: + + /// \brief Direction indicator + /// Symbolic names for the direction the motor is turning + typedef enum + { + DIRECTION_CCW = 0, ///< Clockwise + DIRECTION_CW = 1 ///< Counter-Clockwise + } Direction; + + /// Forces the library to compute a new instantaneous speed and set that as + /// the current speed. It is called by + /// the library: + /// \li after each step + /// \li after change to maxSpeed through setMaxSpeed() + /// \li after change to acceleration through setAcceleration() + /// \li after change to target position (relative or absolute) through + /// move() or moveTo() + void computeNewSpeed(); + + /// Low level function to set the motor output pins + /// bit 0 of the mask corresponds to _pin[0] + /// bit 1 of the mask corresponds to _pin[1] + /// You can override this to impment, for example serial chip output insted of using the + /// output pins directly + virtual void setOutputPins(uint8_t mask); + + /// Called to execute a step. Only called when a new step is + /// required. Subclasses may override to implement new stepping + /// interfaces. The default calls step1(), step2(), step4() or step8() depending on the + /// number of pins defined for the stepper. + /// \param[in] step The current step phase number (0 to 7) + virtual void step(long step); + + /// Called to execute a step using stepper functions (pins = 0) Only called when a new step is + /// required. Calls _forward() or _backward() to perform the step + /// \param[in] step The current step phase number (0 to 7) + virtual void step0(long step); + + /// Called to execute a step on a stepper driver (ie where pins == 1). Only called when a new step is + /// required. Subclasses may override to implement new stepping + /// interfaces. The default sets or clears the outputs of Step pin1 to step, + /// and sets the output of _pin2 to the desired direction. The Step pin (_pin1) is pulsed for 1 microsecond + /// which is the minimum STEP pulse width for the 3967 driver. + /// \param[in] step The current step phase number (0 to 7) + virtual void step1(long step); + + /// Called to execute a step on a 2 pin motor. Only called when a new step is + /// required. Subclasses may override to implement new stepping + /// interfaces. The default sets or clears the outputs of pin1 and pin2 + /// \param[in] step The current step phase number (0 to 7) + virtual void step2(long step); + + /// Called to execute a step on a 3 pin motor, such as HDD spindle. Only called when a new step is + /// required. Subclasses may override to implement new stepping + /// interfaces. The default sets or clears the outputs of pin1, pin2, + /// pin3 + /// \param[in] step The current step phase number (0 to 7) + virtual void step3(long step); + + /// Called to execute a step on a 4 pin motor. Only called when a new step is + /// required. Subclasses may override to implement new stepping + /// interfaces. The default sets or clears the outputs of pin1, pin2, + /// pin3, pin4. + /// \param[in] step The current step phase number (0 to 7) + virtual void step4(long step); + + /// Called to execute a step on a 3 pin motor, such as HDD spindle. Only called when a new step is + /// required. Subclasses may override to implement new stepping + /// interfaces. The default sets or clears the outputs of pin1, pin2, + /// pin3 + /// \param[in] step The current step phase number (0 to 7) + virtual void step6(long step); + + /// Called to execute a step on a 4 pin half-steper motor. Only called when a new step is + /// required. Subclasses may override to implement new stepping + /// interfaces. The default sets or clears the outputs of pin1, pin2, + /// pin3, pin4. + /// \param[in] step The current step phase number (0 to 7) + virtual void step8(long step); + +private: + /// Number of pins on the stepper motor. Permits 2 or 4. 2 pins is a + /// bipolar, and 4 pins is a unipolar. + uint8_t _interface; // 0, 1, 2, 4, 8, See MotorInterfaceType + + /// Arduino pin number assignments for the 2 or 4 pins required to interface to the + /// stepper motor or driver + uint8_t _pin[4]; + + /// Whether the _pins is inverted or not + uint8_t _pinInverted[4]; + + /// The current absolution position in steps. + long _currentPos; // Steps + + /// The target position in steps. The AccelStepper library will move the + /// motor from the _currentPos to the _targetPos, taking into account the + /// max speed, acceleration and deceleration + long _targetPos; // Steps + + /// The current motos speed in steps per second + /// Positive is clockwise + float _speed; // Steps per second + + /// The maximum permitted speed in steps per second. Must be > 0. + float _maxSpeed; + + /// The acceleration to use to accelerate or decelerate the motor in steps + /// per second per second. Must be > 0 + float _acceleration; + float _sqrt_twoa; // Precomputed sqrt(2*_acceleration) + + /// The current interval between steps in microseconds. + /// 0 means the motor is currently stopped with _speed == 0 + unsigned long _stepInterval; + + /// The last step time in microseconds + unsigned long _lastStepTime; + + /// The minimum allowed pulse width in microseconds + unsigned int _minPulseWidth; + + /// Is the direction pin inverted? + ///bool _dirInverted; /// Moved to _pinInverted[1] + + /// Is the step pin inverted? + ///bool _stepInverted; /// Moved to _pinInverted[0] + + /// Is the enable pin inverted? + bool _enableInverted; + + /// Enable pin for stepper driver, or 0xFF if unused. + uint8_t _enablePin; + + /// The pointer to a forward-step procedure + void (*_forward)(); + + /// The pointer to a backward-step procedure + void (*_backward)(); + + /// The step counter for speed calculations + long _n; + + /// Initial step size in microseconds + float _c0; + + /// Last step size in microseconds + float _cn; + + /// Min step size in microseconds based on maxSpeed + float _cmin; // at max speed + + /// Current direction motor is spinning in + boolean _direction; // 1 == CW + +}; + +/// @example Random.pde +/// Make a single stepper perform random changes in speed, position and acceleration + +/// @example Overshoot.pde +/// Check overshoot handling +/// which sets a new target position and then waits until the stepper has +/// achieved it. This is used for testing the handling of overshoots + +/// @example MultiStepper.pde +/// Shows how to multiple simultaneous steppers +/// Runs one stepper forwards and backwards, accelerating and decelerating +/// at the limits. Runs other steppers at the same time + +/// @example ConstantSpeed.pde +/// Shows how to run AccelStepper in the simplest, +/// fixed speed mode with no accelerations + +/// @example Blocking.pde +/// Shows how to use the blocking call runToNewPosition +/// Which sets a new target position and then waits until the stepper has +/// achieved it. + +/// @example AFMotor_MultiStepper.pde +/// Control both Stepper motors at the same time with different speeds +/// and accelerations. + +/// @example AFMotor_ConstantSpeed.pde +/// Shows how to run AccelStepper in the simplest, +/// fixed speed mode with no accelerations + +/// @example ProportionalControl.pde +/// Make a single stepper follow the analog value read from a pot or whatever +/// The stepper will move at a constant speed to each newly set posiiton, +/// depending on the value of the pot. + +/// @example Bounce.pde +/// Make a single stepper bounce from one limit to another, observing +/// accelrations at each end of travel + +/// @example Quickstop.pde +/// Check stop handling. +/// Calls stop() while the stepper is travelling at full speed, causing +/// the stepper to stop as quickly as possible, within the constraints of the +/// current acceleration. + +/// @example MotorShield.pde +/// Shows how to use AccelStepper to control a 3-phase motor, such as a HDD spindle motor +/// using the Adafruit Motor Shield http://www.ladyada.net/make/mshield/index.html. + +/// @example DualMotorShield.pde +/// Shows how to use AccelStepper to control 2 x 2 phase steppers using the +/// Itead Studio Arduino Dual Stepper Motor Driver Shield +/// model IM120417015 + +#endif diff --git a/Arduino/libraries/AccelStepper/LICENSE b/Arduino/libraries/AccelStepper/LICENSE new file mode 100644 index 0000000..da124e1 --- /dev/null +++ b/Arduino/libraries/AccelStepper/LICENSE @@ -0,0 +1,17 @@ +This software is Copyright (C) 2008 Mike McCauley. Use is subject to license +conditions. The main licensing options available are GPL V2 or Commercial: + +Open Source Licensing GPL V2 + +This is the appropriate option if you want to share the source code of your +application with everyone you distribute it to, and you also want to give them +the right to share who uses it. If you wish to use this software under Open +Source Licensing, you must contribute all your source code to the open source +community in accordance with the GPL Version 2 when your application is +distributed. See http://www.gnu.org/copyleft/gpl.html + +Commercial Licensing + +This is the appropriate option if you are creating proprietary applications +and you are not prepared to distribute and share the source code of your +application. Contact info@open.com.au for details. diff --git a/Arduino/libraries/AccelStepper/MANIFEST b/Arduino/libraries/AccelStepper/MANIFEST new file mode 100644 index 0000000..78ec812 --- /dev/null +++ b/Arduino/libraries/AccelStepper/MANIFEST @@ -0,0 +1,35 @@ +AccelStepper/Makefile +AccelStepper/AccelStepper.h +AccelStepper/AccelStepper.cpp +AccelStepper/MANIFEST +AccelStepper/LICENSE +AccelStepper/project.cfg +AccelStepper/keywords.txt +AccelStepper/doc +AccelStepper/examples/Blocking/Blocking.pde +AccelStepper/examples/MultiStepper/MultiStepper.pde +AccelStepper/examples/Overshoot/Overshoot.pde +AccelStepper/examples/ConstantSpeed/ConstantSpeed.pde +AccelStepper/examples/Random/Random.pde +AccelStepper/examples/AFMotor_ConstantSpeed/AFMotor_ConstantSpeed.pde +AccelStepper/examples/AFMotor_MultiStepper/AFMotor_MultiStepper.pde +AccelStepper/examples/ProportionalControl/ProportionalControl.pde +AccelStepper/examples/Bounce/Bounce.pde +AccelStepper/examples/Quickstop/Quickstop.pde +AccelStepper/examples/MotorShield/MotorShield.pde +AccelStepper/examples/DualMotorShield/DualMotorShield.pde +AccelStepper/doc +AccelStepper/doc/index.html +AccelStepper/doc/functions.html +AccelStepper/doc/annotated.html +AccelStepper/doc/tab_l.gif +AccelStepper/doc/tabs.css +AccelStepper/doc/files.html +AccelStepper/doc/classAccelStepper-members.html +AccelStepper/doc/doxygen.css +AccelStepper/doc/AccelStepper_8h-source.html +AccelStepper/doc/tab_r.gif +AccelStepper/doc/doxygen.png +AccelStepper/doc/tab_b.gif +AccelStepper/doc/functions_func.html +AccelStepper/doc/classAccelStepper.html diff --git a/Arduino/libraries/AccelStepper/Makefile b/Arduino/libraries/AccelStepper/Makefile new file mode 100644 index 0000000..83d1c95 --- /dev/null +++ b/Arduino/libraries/AccelStepper/Makefile @@ -0,0 +1,30 @@ +# Makefile +# +# Makefile for the Arduino AccelStepper project +# +# Author: Mike McCauley (mikem@airspayce.com) +# Copyright (C) 2010 Mike McCauley +# $Id: Makefile,v 1.4 2013/03/21 21:48:27 mikem Exp mikem $ + +PROJNAME = AccelStepper +VERSION_MAJOR = 1 +VERSION_MINOR = 47 + +DISTFILE = $(PROJNAME)-$(VERSION_MAJOR).$(VERSION_MINOR).zip + +all: versioning doxygen dist upload + +versioning: + sed -i.bak -e 's/AccelStepper-.*\.zip/$(DISTFILE)/' AccelStepper.h + +doxygen: + doxygen project.cfg + +ci: + (cd ..;ci -l `cat $(PROJNAME)/MANIFEST`) + +dist: + (cd ..; zip $(PROJNAME)/$(DISTFILE) `cat $(PROJNAME)/MANIFEST`) + +upload: + rsync -avz $(DISTFILE) doc/ www.airspayce.com:public_html/mikem/arduino/$(PROJNAME) diff --git a/Arduino/libraries/AccelStepper/doc/AccelStepper_8h-source.html b/Arduino/libraries/AccelStepper/doc/AccelStepper_8h-source.html new file mode 100644 index 0000000..098f9f5 --- /dev/null +++ b/Arduino/libraries/AccelStepper/doc/AccelStepper_8h-source.html @@ -0,0 +1,420 @@ + + +AccelStepper: AccelStepper.h Source File + + + + + +
Generated on Sun Jan 8 17:27:41 2012 for AccelStepper by  + +doxygen 1.5.6
+ + diff --git a/Arduino/libraries/AccelStepper/doc/annotated.html b/Arduino/libraries/AccelStepper/doc/annotated.html new file mode 100644 index 0000000..43c5723 --- /dev/null +++ b/Arduino/libraries/AccelStepper/doc/annotated.html @@ -0,0 +1,62 @@ + + + + + + +AccelStepper: Class List + + + + + + +
+
+ + + + + + +
+
AccelStepper +
+
+
+ + + + +
+
+
+
Class List
+
+
+
Here are the classes, structs, unions and interfaces with brief descriptions:
+ + +
\CAccelStepperSupport for stepper motors with acceleration etc
+
+
+ + + + diff --git a/Arduino/libraries/AccelStepper/doc/classAccelStepper-members.html b/Arduino/libraries/AccelStepper/doc/classAccelStepper-members.html new file mode 100644 index 0000000..961da97 --- /dev/null +++ b/Arduino/libraries/AccelStepper/doc/classAccelStepper-members.html @@ -0,0 +1,105 @@ + + + + + + +AccelStepper: Member List + + + + + + +
+
+ + + + + + +
+
AccelStepper +
+
+
+ + + + +
+
+
+
AccelStepper Member List
+
+
+ +

This is the complete list of members for AccelStepper, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AccelStepper(uint8_t interface=AccelStepper::FULL4WIRE, uint8_t pin1=2, uint8_t pin2=3, uint8_t pin3=4, uint8_t pin4=5, bool enable=true)AccelStepper
AccelStepper(void(*forward)(), void(*backward)())AccelStepper
computeNewSpeed()AccelStepperprotected
currentPosition()AccelStepper
Direction enum nameAccelStepperprotected
DIRECTION_CCW enum valueAccelStepperprotected
DIRECTION_CW enum valueAccelStepperprotected
disableOutputs()AccelSteppervirtual
distanceToGo()AccelStepper
DRIVER enum valueAccelStepper
enableOutputs()AccelSteppervirtual
FULL2WIRE enum valueAccelStepper
FULL3WIRE enum valueAccelStepper
FULL4WIRE enum valueAccelStepper
FUNCTION enum valueAccelStepper
HALF3WIRE enum valueAccelStepper
HALF4WIRE enum valueAccelStepper
MotorInterfaceType enum nameAccelStepper
move(long relative)AccelStepper
moveTo(long absolute)AccelStepper
run()AccelStepper
runSpeed()AccelStepper
runSpeedToPosition()AccelStepper
runToNewPosition(long position)AccelStepper
runToPosition()AccelStepper
setAcceleration(float acceleration)AccelStepper
setCurrentPosition(long position)AccelStepper
setEnablePin(uint8_t enablePin=0xff)AccelStepper
setMaxSpeed(float speed)AccelStepper
setMinPulseWidth(unsigned int minWidth)AccelStepper
setOutputPins(uint8_t mask)AccelStepperprotectedvirtual
setPinsInverted(bool directionInvert=false, bool stepInvert=false, bool enableInvert=false)AccelStepper
setPinsInverted(bool pin1Invert, bool pin2Invert, bool pin3Invert, bool pin4Invert, bool enableInvert)AccelStepper
setSpeed(float speed)AccelStepper
speed()AccelStepper
step(long step)AccelStepperprotectedvirtual
step0(long step)AccelStepperprotectedvirtual
step1(long step)AccelStepperprotectedvirtual
step2(long step)AccelStepperprotectedvirtual
step3(long step)AccelStepperprotectedvirtual
step4(long step)AccelStepperprotectedvirtual
step6(long step)AccelStepperprotectedvirtual
step8(long step)AccelStepperprotectedvirtual
stop()AccelStepper
targetPosition()AccelStepper
+ + + + diff --git a/Arduino/libraries/AccelStepper/doc/classAccelStepper.html b/Arduino/libraries/AccelStepper/doc/classAccelStepper.html new file mode 100644 index 0000000..f83654d --- /dev/null +++ b/Arduino/libraries/AccelStepper/doc/classAccelStepper.html @@ -0,0 +1,1251 @@ + + + + + + +AccelStepper: AccelStepper Class Reference + + + + + + +
+
+ + + + + + +
+
AccelStepper +
+
+
+ + + + +
+ +
+ +

Support for stepper motors with acceleration etc. + More...

+ +

#include <AccelStepper.h>

+ + + + + +

+Public Types

enum  MotorInterfaceType {
+  FUNCTION = 0, +DRIVER = 1, +FULL2WIRE = 2, +FULL3WIRE = 3, +
+  FULL4WIRE = 4, +HALF3WIRE = 6, +HALF4WIRE = 8 +
+ }
 Symbolic names for number of pins. Use this in the pins argument the AccelStepper constructor to provide a symbolic name for the number of pins to use. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 AccelStepper (uint8_t interface=AccelStepper::FULL4WIRE, uint8_t pin1=2, uint8_t pin2=3, uint8_t pin3=4, uint8_t pin4=5, bool enable=true)
 
 AccelStepper (void(*forward)(), void(*backward)())
 
void moveTo (long absolute)
 
void move (long relative)
 
boolean run ()
 
boolean runSpeed ()
 
void setMaxSpeed (float speed)
 
void setAcceleration (float acceleration)
 
void setSpeed (float speed)
 
float speed ()
 
long distanceToGo ()
 
long targetPosition ()
 
long currentPosition ()
 
void setCurrentPosition (long position)
 
void runToPosition ()
 
boolean runSpeedToPosition ()
 
void runToNewPosition (long position)
 
void stop ()
 
virtual void disableOutputs ()
 
virtual void enableOutputs ()
 
void setMinPulseWidth (unsigned int minWidth)
 
void setEnablePin (uint8_t enablePin=0xff)
 
void setPinsInverted (bool directionInvert=false, bool stepInvert=false, bool enableInvert=false)
 
void setPinsInverted (bool pin1Invert, bool pin2Invert, bool pin3Invert, bool pin4Invert, bool enableInvert)
 
+ + + + +

+Protected Types

enum  Direction { DIRECTION_CCW = 0, +DIRECTION_CW = 1 + }
 Direction indicator Symbolic names for the direction the motor is turning. More...
 
+ + + + + + + + + + + + + + + + + + + + + +

+Protected Member Functions

void computeNewSpeed ()
 
virtual void setOutputPins (uint8_t mask)
 
virtual void step (long step)
 
virtual void step0 (long step)
 
virtual void step1 (long step)
 
virtual void step2 (long step)
 
virtual void step3 (long step)
 
virtual void step4 (long step)
 
virtual void step6 (long step)
 
virtual void step8 (long step)
 
+

Detailed Description

+

Support for stepper motors with acceleration etc.

+
Author
Mike McCauley (mikem.nosp@m.@air.nosp@m.spayc.nosp@m.e.co.nosp@m.m) DO NOT CONTACT THE AUTHOR DIRECTLY: USE THE LISTS
+

This defines a single 2 or 4 pin stepper motor, or stepper moter with fdriver chip, with optional acceleration, deceleration, absolute positioning commands etc. Multiple simultaneous steppers are supported, all moving at different speeds and accelerations.

+
Operation
This module operates by computing a step time in microseconds. The step time is recomputed after each step and after speed and acceleration parameters are changed by the caller. The time of each step is recorded in microseconds. The run() function steps the motor once if a new step is due. The run() function must be called frequently until the motor is in the desired position, after which time run() will do nothing.
+
Positioning
Positions are specified by a signed long integer. At construction time, the current position of the motor is consider to be 0. Positive positions are clockwise from the initial position; negative positions are anticlockwise. The current position can be altered for instance after initialization positioning.
+
Caveats
This is an open loop controller: If the motor stalls or is oversped, AccelStepper will not have a correct idea of where the motor really is (since there is no feedback of the motor's real position. We only know where we think it is, relative to the initial starting point).
+
Performance
The fastest motor speed that can be reliably supported is about 4000 steps per second at a clock frequency of 16 MHz on Arduino such as Uno etc. Faster processors can support faster stepping speeds. However, any speed less than that down to very slow speeds (much less than one per second) are also supported, provided the run() function is called frequently enough to step the motor whenever required for the speed set. Calling setAcceleration() is expensive, since it requires a square root to be calculated.
+
Examples:
AFMotor_ConstantSpeed.pde, AFMotor_MultiStepper.pde, Blocking.pde, Bounce.pde, ConstantSpeed.pde, DualMotorShield.pde, MotorShield.pde, MultiStepper.pde, Overshoot.pde, ProportionalControl.pde, Quickstop.pde, and Random.pde.
+

Member Enumeration Documentation

+ +
+
+ + + + + +
+ + + + +
enum AccelStepper::Direction
+
+protected
+
+ +

Direction indicator Symbolic names for the direction the motor is turning.

+ + + +
Enumerator
DIRECTION_CCW  +

Clockwise.

+
DIRECTION_CW  +

Counter-Clockwise.

+
+ +
+
+ +
+
+ +

Symbolic names for number of pins. Use this in the pins argument the AccelStepper constructor to provide a symbolic name for the number of pins to use.

+ + + + + + + + +
Enumerator
FUNCTION  +

Use the functional interface, implementing your own driver functions (internal use only)

+
DRIVER  +

Stepper Driver, 2 driver pins required.

+
FULL2WIRE  +

2 wire stepper, 2 motor pins required

+
FULL3WIRE  +

3 wire stepper, such as HDD spindle, 3 motor pins required

+
FULL4WIRE  +

4 wire full stepper, 4 motor pins required

+
HALF3WIRE  +

3 wire half stepper, such as HDD spindle, 3 motor pins required

+
HALF4WIRE  +

4 wire half stepper, 4 motor pins required

+
+ +
+
+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AccelStepper::AccelStepper (uint8_t interface = AccelStepper::FULL4WIRE,
uint8_t pin1 = 2,
uint8_t pin2 = 3,
uint8_t pin3 = 4,
uint8_t pin4 = 5,
bool enable = true 
)
+
+

Constructor. You can have multiple simultaneous steppers, all moving at different speeds and accelerations, provided you call their run() functions at frequent enough intervals. Current Position is set to 0, target position is set to 0. MaxSpeed and Acceleration default to 1.0. The motor pins will be initialised to OUTPUT mode during the constructor by a call to enableOutputs().

+
Parameters
+ + + + + + + +
[in]interfaceNumber of pins to interface to. 1, 2, 4 or 8 are supported, but it is preferred to use the MotorInterfaceType symbolic names. AccelStepper::DRIVER (1) means a stepper driver (with Step and Direction pins). If an enable line is also needed, call setEnablePin() after construction. You may also invert the pins using setPinsInverted(). AccelStepper::FULL2WIRE (2) means a 2 wire stepper (2 pins required). AccelStepper::FULL3WIRE (3) means a 3 wire stepper, such as HDD spindle (3 pins required). AccelStepper::FULL4WIRE (4) means a 4 wire stepper (4 pins required). AccelStepper::HALF3WIRE (6) means a 3 wire half stepper, such as HDD spindle (3 pins required) AccelStepper::HALF4WIRE (8) means a 4 wire half stepper (4 pins required) Defaults to AccelStepper::FULL4WIRE (4) pins.
[in]pin1Arduino digital pin number for motor pin 1. Defaults to pin 2. For a AccelStepper::DRIVER (interface==1), this is the Step input to the driver. Low to high transition means to step)
[in]pin2Arduino digital pin number for motor pin 2. Defaults to pin 3. For a AccelStepper::DRIVER (interface==1), this is the Direction input the driver. High means forward.
[in]pin3Arduino digital pin number for motor pin 3. Defaults to pin 4.
[in]pin4Arduino digital pin number for motor pin 4. Defaults to pin 5.
[in]enableIf this is true (the default), enableOutputs() will be called to enable the output pins at construction time.
+
+
+ +

References DIRECTION_CCW, enableOutputs(), and setAcceleration().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
AccelStepper::AccelStepper (void(*)() forward,
void(*)() backward 
)
+
+

Alternate Constructor which will call your own functions for forward and backward steps. You can have multiple simultaneous steppers, all moving at different speeds and accelerations, provided you call their run() functions at frequent enough intervals. Current Position is set to 0, target position is set to 0. MaxSpeed and Acceleration default to 1.0. Any motor initialization should happen before hand, no pins are used or initialized.

+
Parameters
+ + + +
[in]forwardvoid-returning procedure that will make a forward step
[in]backwardvoid-returning procedure that will make a backward step
+
+
+ +

References DIRECTION_CCW, and setAcceleration().

+ +
+
+

Member Function Documentation

+ +
+
+ + + + + +
+ + + + + + + +
void AccelStepper::computeNewSpeed ()
+
+protected
+
+

Forces the library to compute a new instantaneous speed and set that as the current speed. It is called by the library:

+ + +

References DIRECTION_CCW, DIRECTION_CW, and distanceToGo().

+ +

Referenced by moveTo(), run(), setAcceleration(), and setMaxSpeed().

+ +
+
+ +
+
+ + + + + + + +
long AccelStepper::currentPosition ()
+
+

The currently motor position.

+
Returns
the current motor position in steps. Positive is clockwise from the 0 position.
+
Examples:
Bounce.pde, MultiStepper.pde, Overshoot.pde, and Quickstop.pde.
+
+
+
+ +
+
+ + + + + +
+ + + + + + + +
void AccelStepper::disableOutputs ()
+
+virtual
+
+

Disable motor pin outputs by setting them all LOW Depending on the design of your electronics this may turn off the power to the motor coils, saving power. This is useful to support Arduino low power modes: disable the outputs during sleep and then reenable with enableOutputs() before stepping again.

+ +

References setOutputPins().

+ +
+
+ +
+
+ + + + + + + +
long AccelStepper::distanceToGo ()
+
+

The distance from the current position to the target position.

+
Returns
the distance from the current position to the target position in steps. Positive is clockwise from the current position.
+
Examples:
Bounce.pde, MultiStepper.pde, and Random.pde.
+
+

Referenced by computeNewSpeed(), and run().

+ +
+
+ +
+
+ + + + + +
+ + + + + + + +
void AccelStepper::enableOutputs ()
+
+virtual
+
+

Enable motor pin outputs by setting the motor pins to OUTPUT mode. Called automatically by the constructor.

+ +

References FULL3WIRE, FULL4WIRE, HALF3WIRE, and HALF4WIRE.

+ +

Referenced by AccelStepper().

+ +
+
+ +
+
+ + + + + + + + +
void AccelStepper::move (long relative)
+
+

Set the target position relative to the current position

+
Parameters
+ + +
[in]relativeThe desired position relative to the current position. Negative is anticlockwise from the current position.
+
+
+ +

References moveTo().

+ +

Referenced by stop().

+ +
+
+ +
+
+ + + + + + + + +
void AccelStepper::moveTo (long absolute)
+
+

Set the target position. The run() function will try to move the motor (at most one step per call) from the current position to the target position set by the most recent call to this function. Caution: moveTo() also recalculates the speed for the next step. If you are trying to use constant speed movements, you should call setSpeed() after calling moveTo().

+
Parameters
+ + +
[in]absoluteThe desired absolute position. Negative is anticlockwise from the 0 position.
+
+
+
Examples:
Bounce.pde, MultiStepper.pde, Overshoot.pde, ProportionalControl.pde, Quickstop.pde, and Random.pde.
+
+

References computeNewSpeed().

+ +

Referenced by move(), and runToNewPosition().

+ +
+
+ +
+
+ + + + + + + +
boolean AccelStepper::run ()
+
+

Poll the motor and step it if a step is due, implementing accelerations and decelerations to acheive the target position. You must call this as frequently as possible, but at least once per minimum step time interval, preferably in your main loop. Note that each call to run() will make at most one step, and then only when a step is due, based on the current speed and the time since the last step.

+
Returns
true if the motor is still running to the target position.
+
Examples:
Bounce.pde, MultiStepper.pde, Overshoot.pde, Quickstop.pde, and Random.pde.
+
+

References computeNewSpeed(), distanceToGo(), and runSpeed().

+ +

Referenced by runToPosition().

+ +
+
+ +
+
+ + + + + + + +
boolean AccelStepper::runSpeed ()
+
+

Poll the motor and step it if a step is due, implementing a constant speed as set by the most recent call to setSpeed(). You must call this as frequently as possible, but at least once per step interval,

+
Returns
true if the motor was stepped.
+
Examples:
ConstantSpeed.pde.
+
+

References DIRECTION_CW, and step().

+ +

Referenced by run(), and runSpeedToPosition().

+ +
+
+ +
+
+ + + + + + + +
boolean AccelStepper::runSpeedToPosition ()
+
+

Runs at the currently selected speed until the target position is reached Does not implement accelerations.

+
Returns
true if it stepped
+
Examples:
ProportionalControl.pde.
+
+

References DIRECTION_CCW, DIRECTION_CW, and runSpeed().

+ +
+
+ +
+
+ + + + + + + + +
void AccelStepper::runToNewPosition (long position)
+
+

Moves the motor (with acceleration/deceleration) to the new target position and blocks until it is at position. Dont use this in event loops, since it blocks.

+
Parameters
+ + +
[in]positionThe new target position.
+
+
+
Examples:
Blocking.pde, and Overshoot.pde.
+
+

References moveTo(), and runToPosition().

+ +
+
+ +
+
+ + + + + + + +
void AccelStepper::runToPosition ()
+
+

Moves the motor (with acceleration/deceleration) to the target position and blocks until it is at position. Dont use this in event loops, since it blocks.

+
Examples:
Quickstop.pde.
+
+

References run().

+ +

Referenced by runToNewPosition().

+ +
+
+ +
+
+ + + + + + + + +
void AccelStepper::setAcceleration (float acceleration)
+
+

Sets the acceleration/deceleration rate.

+
Parameters
+ + +
[in]accelerationThe desired acceleration in steps per second per second. Must be > 0.0. This is an expensive call since it requires a square root to be calculated. Dont call more ofthen than needed
+
+
+
Examples:
Blocking.pde, Bounce.pde, MultiStepper.pde, Overshoot.pde, Quickstop.pde, and Random.pde.
+
+

References computeNewSpeed().

+ +

Referenced by AccelStepper().

+ +
+
+ +
+
+ + + + + + + + +
void AccelStepper::setCurrentPosition (long position)
+
+

Resets the current position of the motor, so that wherever the motor happens to be right now is considered to be the new 0 position. Useful for setting a zero position on a stepper after an initial hardware positioning move. Has the side effect of setting the current motor speed to 0.

+
Parameters
+ + +
[in]positionThe position in steps of wherever the motor happens to be right now.
+
+
+ +
+
+ +
+
+ + + + + + + + +
void AccelStepper::setEnablePin (uint8_t enablePin = 0xff)
+
+

Sets the enable pin number for stepper drivers. 0xFF indicates unused (default). Otherwise, if a pin is set, the pin will be turned on when enableOutputs() is called and switched off when disableOutputs() is called.

+
Parameters
+ + +
[in]enablePinArduino digital pin number for motor enable
+
+
+
See Also
setPinsInverted
+ +
+
+ +
+
+ + + + + + + + +
void AccelStepper::setMaxSpeed (float speed)
+
+

Sets the maximum permitted speed. The run() function will accelerate up to the speed set by this function. Caution: the maximum speed achievable depends on your processor and clock speed.

+
Parameters
+ + +
[in]speedThe desired maximum speed in steps per second. Must be > 0. Caution: Speeds that exceed the maximum speed supported by the processor may Result in non-linear accelerations and decelerations.
+
+
+
Examples:
Blocking.pde, Bounce.pde, ConstantSpeed.pde, MultiStepper.pde, Overshoot.pde, ProportionalControl.pde, Quickstop.pde, and Random.pde.
+
+

References computeNewSpeed(), and speed().

+ +
+
+ +
+
+ + + + + + + + +
void AccelStepper::setMinPulseWidth (unsigned int minWidth)
+
+

Sets the minimum pulse width allowed by the stepper driver. The minimum practical pulse width is approximately 20 microseconds. Times less than 20 microseconds will usually result in 20 microseconds or so.

+
Parameters
+ + +
[in]minWidthThe minimum pulse width in microseconds.
+
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void AccelStepper::setOutputPins (uint8_t mask)
+
+protectedvirtual
+
+

Low level function to set the motor output pins bit 0 of the mask corresponds to _pin[0] bit 1 of the mask corresponds to _pin[1] You can override this to impment, for example serial chip output insted of using the output pins directly

+
Examples:
MotorShield.pde.
+
+

References FULL3WIRE, FULL4WIRE, HALF3WIRE, and HALF4WIRE.

+ +

Referenced by disableOutputs(), step1(), step2(), step3(), step4(), step6(), and step8().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void AccelStepper::setPinsInverted (bool directionInvert = false,
bool stepInvert = false,
bool enableInvert = false 
)
+
+

Sets the inversion for stepper driver pins

+
Parameters
+ + + + +
[in]directionInvertTrue for inverted direction pin, false for non-inverted
[in]stepInvertTrue for inverted step pin, false for non-inverted
[in]enableInvertTrue for inverted enable pin, false (default) for non-inverted
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void AccelStepper::setPinsInverted (bool pin1Invert,
bool pin2Invert,
bool pin3Invert,
bool pin4Invert,
bool enableInvert 
)
+
+

Sets the inversion for 2, 3 and 4 wire stepper pins

+
Parameters
+ + + + + + +
[in]pin1InvertTrue for inverted pin1, false for non-inverted
[in]pin2InvertTrue for inverted pin2, false for non-inverted
[in]pin3InvertTrue for inverted pin3, false for non-inverted
[in]pin4InvertTrue for inverted pin4, false for non-inverted
[in]enableInvertTrue for inverted enable pin, false (default) for non-inverted
+
+
+ +
+
+ +
+
+ + + + + + + + +
void AccelStepper::setSpeed (float speed)
+
+

Sets the desired constant speed for use with runSpeed().

+
Parameters
+ + +
[in]speedThe desired constant speed in steps per second. Positive is clockwise. Speeds of more than 1000 steps per second are unreliable. Very slow speeds may be set (eg 0.00027777 for once per hour, approximately. Speed accuracy depends on the Arduino crystal. Jitter depends on how frequently you call the runSpeed() function.
+
+
+
Examples:
ConstantSpeed.pde, and ProportionalControl.pde.
+
+

References DIRECTION_CCW, DIRECTION_CW, and speed().

+ +
+
+ +
+
+ + + + + + + +
float AccelStepper::speed ()
+
+

The most recently set speed

+
Returns
the most recent speed in steps per second
+ +

Referenced by setMaxSpeed(), and setSpeed().

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void AccelStepper::step (long step)
+
+protectedvirtual
+
+

Called to execute a step. Only called when a new step is required. Subclasses may override to implement new stepping interfaces. The default calls step1(), step2(), step4() or step8() depending on the number of pins defined for the stepper.

+
Parameters
+ + +
[in]stepThe current step phase number (0 to 7)
+
+
+ +

References DRIVER, FULL2WIRE, FULL3WIRE, FULL4WIRE, FUNCTION, HALF3WIRE, HALF4WIRE, step0(), step1(), step2(), step3(), step4(), step6(), and step8().

+ +

Referenced by runSpeed().

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void AccelStepper::step0 (long step)
+
+protectedvirtual
+
+

Called to execute a step using stepper functions (pins = 0) Only called when a new step is required. Calls _forward() or _backward() to perform the step

+
Parameters
+ + +
[in]stepThe current step phase number (0 to 7)
+
+
+ +

Referenced by step().

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void AccelStepper::step1 (long step)
+
+protectedvirtual
+
+

Called to execute a step on a stepper driver (ie where pins == 1). Only called when a new step is required. Subclasses may override to implement new stepping interfaces. The default sets or clears the outputs of Step pin1 to step, and sets the output of _pin2 to the desired direction. The Step pin (_pin1) is pulsed for 1 microsecond which is the minimum STEP pulse width for the 3967 driver.

+
Parameters
+ + +
[in]stepThe current step phase number (0 to 7)
+
+
+ +

References setOutputPins().

+ +

Referenced by step().

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void AccelStepper::step2 (long step)
+
+protectedvirtual
+
+

Called to execute a step on a 2 pin motor. Only called when a new step is required. Subclasses may override to implement new stepping interfaces. The default sets or clears the outputs of pin1 and pin2

+
Parameters
+ + +
[in]stepThe current step phase number (0 to 7)
+
+
+ +

References setOutputPins().

+ +

Referenced by step().

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void AccelStepper::step3 (long step)
+
+protectedvirtual
+
+

Called to execute a step on a 3 pin motor, such as HDD spindle. Only called when a new step is required. Subclasses may override to implement new stepping interfaces. The default sets or clears the outputs of pin1, pin2, pin3

+
Parameters
+ + +
[in]stepThe current step phase number (0 to 7)
+
+
+ +

References setOutputPins().

+ +

Referenced by step().

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void AccelStepper::step4 (long step)
+
+protectedvirtual
+
+

Called to execute a step on a 4 pin motor. Only called when a new step is required. Subclasses may override to implement new stepping interfaces. The default sets or clears the outputs of pin1, pin2, pin3, pin4.

+
Parameters
+ + +
[in]stepThe current step phase number (0 to 7)
+
+
+ +

References setOutputPins().

+ +

Referenced by step().

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void AccelStepper::step6 (long step)
+
+protectedvirtual
+
+

Called to execute a step on a 3 pin motor, such as HDD spindle. Only called when a new step is required. Subclasses may override to implement new stepping interfaces. The default sets or clears the outputs of pin1, pin2, pin3

+
Parameters
+ + +
[in]stepThe current step phase number (0 to 7)
+
+
+ +

References setOutputPins().

+ +

Referenced by step().

+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
void AccelStepper::step8 (long step)
+
+protectedvirtual
+
+

Called to execute a step on a 4 pin half-steper motor. Only called when a new step is required. Subclasses may override to implement new stepping interfaces. The default sets or clears the outputs of pin1, pin2, pin3, pin4.

+
Parameters
+ + +
[in]stepThe current step phase number (0 to 7)
+
+
+ +

References setOutputPins().

+ +

Referenced by step().

+ +
+
+ +
+
+ + + + + + + +
void AccelStepper::stop ()
+
+

Sets a new target position that causes the stepper to stop as quickly as possible, using the current speed and acceleration parameters.

+
Examples:
Quickstop.pde.
+
+

References move().

+ +
+
+ +
+
+ + + + + + + +
long AccelStepper::targetPosition ()
+
+

The most recently set target position.

+
Returns
the target position in steps. Positive is clockwise from the 0 position.
+ +
+
+
The documentation for this class was generated from the following files: +
+ + + + diff --git a/Arduino/libraries/AccelStepper/doc/doxygen.css b/Arduino/libraries/AccelStepper/doc/doxygen.css new file mode 100644 index 0000000..4699e69 --- /dev/null +++ b/Arduino/libraries/AccelStepper/doc/doxygen.css @@ -0,0 +1,1357 @@ +/* The standard CSS for doxygen 1.8.5 */ + +body, table, div, p, dl { + font: 400 14px/22px Roboto,sans-serif; +} + +/* @group Heading Levels */ + +h1.groupheader { + font-size: 150%; +} + +.title { + font: 400 14px/28px Roboto,sans-serif; + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h2.groupheader { + border-bottom: 1px solid #879ECB; + color: #354C7B; + font-size: 150%; + font-weight: normal; + margin-top: 1.75em; + padding-top: 8px; + padding-bottom: 4px; + width: 100%; +} + +h3.groupheader { + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px cyan; +} + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd, p.starttd { + margin-top: 2px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #9CAFD4; + color: #ffffff; + border: 1px double #869DCA; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code, a.code:visited, a.line, a.line:visited { + color: #4665A2; +} + +a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: monospace, fixed; + font-size: 105%; +} + +div.fragment { + padding: 0px; + margin: 0px; + background-color: #FBFCFD; + border: 1px solid #C4CFE5; +} + +div.line { + font-family: monospace, fixed; + font-size: 13px; + min-height: 13px; + line-height: 1.0; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +div.line.glow { + background-color: cyan; + box-shadow: 0 0 10px cyan; +} + + +span.lineno { + padding-right: 4px; + text-align: right; + border-right: 2px solid #0F0; + background-color: #E8E8E8; + white-space: pre; +} +span.lineno a { + background-color: #D8D8D8; +} + +span.lineno a:hover { + background-color: #C8C8C8; +} + +div.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + box-shadow: 2px 2px 3px #999; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background-color: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 8px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C4CFE5; + margin: 2px 0px 2px 0; + padding: 2px 10px; + white-space: nowrap; + vertical-align: top; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +blockquote { + background-color: #F7F8FB; + border-left: 2px solid #9CAFD4; + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.memberdecls td, .fieldtable tr { + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: cyan; + box-shadow: 0 0 15px cyan; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memSeparator { + border-bottom: 1px solid #DEE4F0; + line-height: 1px; + margin: 0px; + padding: 0px; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight { + width: 100%; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; + font-size: 80%; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 9px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; + -webkit-transition: box-shadow 0.5s linear; + -moz-transition: box-shadow 0.5s linear; + -ms-transition: box-shadow 0.5s linear; + -o-transition: box-shadow 0.5s linear; + transition: box-shadow 0.5s linear; + display: table !important; + width: 100%; +} + +.memitem.glow { + box-shadow: 0 0 15px cyan; +} + +.memname { + font-weight: bold; + margin-left: 6px; +} + +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 4px; + border-top-left-radius: 4px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 4px; + -moz-border-radius-topleft: 4px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 4px; + -webkit-border-top-left-radius: 4px; + +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 10px 2px 10px; + background-color: #FBFCFD; + border-top-width: 0; + background-image:url('nav_g.png'); + background-repeat:repeat-x; + background-color: #FFFFFF; + /* opera specific markup */ + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} +.paramname code { + line-height: 14px; +} + +.params, .retval, .exception, .tparams { + margin-left: 0px; + padding-left: 0px; +} + +.params .paramname, .retval .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir { + font-family: "courier new",courier,monospace; + vertical-align: top; +} + +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: #728DC1; + border-top:1px solid #5373B4; + border-left:1px solid #5373B4; + border-right:1px solid #C4CFE5; + border-bottom:1px solid #C4CFE5; + text-shadow: none; + color: white; + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; + vertical-align: middle; +} + + + +/* @end */ + +/* these are for tree view when not used as main index */ + +div.directory { + margin: 10px 0px; + border-top: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + width: 100%; +} + +.directory table { + border-collapse:collapse; +} + +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; +} + +.directory td.entry { + white-space: nowrap; + padding-right: 6px; + padding-top: 3px; +} + +.directory td.entry a { + outline:none; +} + +.directory td.entry a img { + border: none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + padding-top: 3px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.even { + padding-left: 6px; + background-color: #F7F8FB; +} + +.directory img { + vertical-align: -30%; +} + +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; +} + +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: #3D578C; +} + +div.dynheader { + margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +table.fieldtable { + /*width: 100%;*/ + margin-bottom: 10px; + border: 1px solid #A8B8D9; + border-spacing: 0px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + vertical-align: top; +} + +.fieldtable td.fieldname { + padding-top: 3px; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid #A8B8D9; + /*width: 100%;*/ +} + +.fieldtable td.fielddoc p:first-child { + margin-top: 0px; +} + +.fieldtable td.fielddoc p:last-child { + margin-bottom: 2px; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + font-size: 90%; + color: #253555; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid #A8B8D9; +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + background-position: 0 -5px; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; + color: #283A5D; + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; +} + +.navpath li.navelem a:hover +{ + color:#6884BD; +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#364D7C; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +div.ingroups +{ + font-size: 8pt; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +dl +{ + padding: 0 0 0 10px; +} + +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ +dl.section +{ + margin-left: 0px; + padding-left: 0px; +} + +dl.note +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #D0C000; +} + +dl.warning, dl.attention +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #00D000; +} + +dl.deprecated +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #505050; +} + +dl.todo +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #00C0E0; +} + +dl.test +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #3030E0; +} + +dl.bug +{ + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; + border-color: #C08050; +} + +dl.section dd { + margin-bottom: 6px; +} + + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectname +{ + font: 300% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font: 120% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font: 50% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #5373B4; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +div.zoom +{ + border: 1px solid #90A5CE; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:#334975; + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; +} + +dl.citelist dd { + margin:2px 0; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: #F4F6FA; + border: 1px solid #D8DFEE; + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 20px 10px 10px; + width: 200px; +} + +div.toc li { + background: url("bdwn.png") no-repeat scroll 0 5px transparent; + font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +div.toc h3 { + font: bold 12px/1.2 Arial,FreeSans,sans-serif; + color: #4665A2; + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.level2 { + margin-left: 15px; +} + +div.toc li.level3 { + margin-left: 30px; +} + +div.toc li.level4 { + margin-left: 45px; +} + +.inherit_header { + font-weight: bold; + color: gray; + cursor: pointer; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.inherit_header td { + padding: 6px 0px 2px 5px; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} + +/* tooltip related style info */ + +.ttc { + position: absolute; + display: none; +} + +#powerTip { + cursor: default; + white-space: nowrap; + background-color: white; + border: 1px solid gray; + border-radius: 4px 4px 4px 4px; + box-shadow: 1px 1px 7px gray; + display: none; + font-size: smaller; + max-width: 80%; + opacity: 0.9; + padding: 1ex 1em 1em; + position: absolute; + z-index: 2147483647; +} + +#powerTip div.ttdoc { + color: grey; + font-style: italic; +} + +#powerTip div.ttname a { + font-weight: bold; +} + +#powerTip div.ttname { + font-weight: bold; +} + +#powerTip div.ttdeci { + color: #006318; +} + +#powerTip div { + margin: 0px; + padding: 0px; + font: 12px/16px Roboto,sans-serif; +} + +#powerTip:before, #powerTip:after { + content: ""; + position: absolute; + margin: 0px; +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.s:after, #powerTip.s:before, +#powerTip.w:after, #powerTip.w:before, +#powerTip.e:after, #powerTip.e:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.nw:after, #powerTip.nw:before, +#powerTip.sw:after, #powerTip.sw:before { + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; +} + +#powerTip.n:after, #powerTip.s:after, +#powerTip.w:after, #powerTip.e:after, +#powerTip.nw:after, #powerTip.ne:after, +#powerTip.sw:after, #powerTip.se:after { + border-color: rgba(255, 255, 255, 0); +} + +#powerTip.n:before, #powerTip.s:before, +#powerTip.w:before, #powerTip.e:before, +#powerTip.nw:before, #powerTip.ne:before, +#powerTip.sw:before, #powerTip.se:before { + border-color: rgba(128, 128, 128, 0); +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.nw:after, #powerTip.nw:before { + top: 100%; +} + +#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { + border-top-color: #ffffff; + border-width: 10px; + margin: 0px -10px; +} +#powerTip.n:before { + border-top-color: #808080; + border-width: 11px; + margin: 0px -11px; +} +#powerTip.n:after, #powerTip.n:before { + left: 50%; +} + +#powerTip.nw:after, #powerTip.nw:before { + right: 14px; +} + +#powerTip.ne:after, #powerTip.ne:before { + left: 14px; +} + +#powerTip.s:after, #powerTip.s:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.sw:after, #powerTip.sw:before { + bottom: 100%; +} + +#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { + border-bottom-color: #ffffff; + border-width: 10px; + margin: 0px -10px; +} + +#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { + border-bottom-color: #808080; + border-width: 11px; + margin: 0px -11px; +} + +#powerTip.s:after, #powerTip.s:before { + left: 50%; +} + +#powerTip.sw:after, #powerTip.sw:before { + right: 14px; +} + +#powerTip.se:after, #powerTip.se:before { + left: 14px; +} + +#powerTip.e:after, #powerTip.e:before { + left: 100%; +} +#powerTip.e:after { + border-left-color: #ffffff; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.e:before { + border-left-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +#powerTip.w:after, #powerTip.w:before { + right: 100%; +} +#powerTip.w:after { + border-right-color: #ffffff; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.w:before { + border-right-color: #808080; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} + diff --git a/Arduino/libraries/AccelStepper/doc/doxygen.png b/Arduino/libraries/AccelStepper/doc/doxygen.png new file mode 100644 index 0000000000000000000000000000000000000000..3ff17d807fd8aa003bed8bb2a69e8f0909592fd1 GIT binary patch literal 3779 zcmV;!4m|ORP)tMIv#Q0*~7*`IBSO7_x;@a8#Zk6_PeKR_s92J&)(m+);m9Iz3blw)z#Gi zP!9lj4$%+*>Hz@HCmM9L9|8c+0u=!H$O3?R0Kgx|#WP<6fKfC8fM-CQZT|_r@`>VO zX^Hgb|9cJqpdJA5$MCEK`F_2@2Y@s>^+;pF`~jdI0Pvr|vl4`=C)EH@1IFe7pdJ8F zH(qGi004~QnF)Ggga~8v08kGAs2hKTATxr7pwfNk|4#_AaT>w8P6TV+R2kbS$v==} zAjf`s0g#V8lB+b3)5oEI*q+{Yt$MZDruD2^;$+(_%Qn+%v0X-bJO=;@kiJ^ygLBnC z?1OVv_%aex1M@jKU|Z~$eI?PoF4Vj>fDzyo zAiLfpXY*a^Sj-S5D0S3@#V$sRW)g)_1e#$%8xdM>Jm7?!h zu0P2X=xoN>^!4DoPRgph2(2va07yfpXF+WH7EOg1GY%Zn z7~1A<(z7Q$ktEXhW_?GMpHp9l_UL18F3KOsxu81pqoBiNbFSGsof-W z6~eloMoz=4?OOnl2J268x5rOY`dCk0us(uS#Ud4yqOr@?=Q57a}tit|BhY>}~frH1sP`ScHS_d)oqH^lYy zZ%VP`#10MlE~P?cE(%(#(AUSv_T{+;t@$U}El}(1ig`vZo`Rm;+5&(AYzJ^Ae=h2X z@Re%vHwZU>|f0NI&%$*4eJweC5OROQrpPMA@*w|o z()A==l}(@bv^&>H1Ob3C=<^|hob?0+xJ?QQ3-ueQC}zy&JQNib!OqSO@-=>XzxlSF zAZ^U*1l6EEmg3r};_HY>&Jo_{dOPEFTWPmt=U&F#+0(O59^UIlHbNX+eF8UzyDR*T z(=5X$VF3!gm@RooS-&iiUYGG^`hMR(07zr_xP`d!^BH?uD>Phl8Rdifx3Af^Zr`Ku ztL+~HkVeL#bJ)7;`=>;{KNRvjmc}1}c58Sr#Treq=4{xo!ATy|c>iRSp4`dzMMVd@ zL8?uwXDY}Wqgh4mH`|$BTXpUIu6A1-cSq%hJw;@^Zr8TP=GMh*p(m(tN7@!^D~sl$ zz^tf4II4|};+irE$Fnm4NTc5%p{PRA`%}Zk`CE5?#h3|xcyQsS#iONZ z6H(@^i9td!$z~bZiJLTax$o>r(p}3o@< zyD7%(>ZYvy=6$U3e!F{Z`uSaYy`xQyl?b{}eg|G3&fz*`QH@mDUn)1%#5u`0m$%D} z?;tZ0u(mWeMV0QtzjgN!lT*pNRj;6510Wwx?Yi_=tYw|J#7@(Xe7ifDzXuK;JB;QO z#bg~K$cgm$@{QiL_3yr}y&~wuv=P=#O&Tj=Sr)aCUlYmZMcw?)T?c%0rUe1cS+o!qs_ zQ6Gp)-{)V!;=q}llyK3|^WeLKyjf%y;xHku;9(vM!j|~<7w1c*Mk-;P{T&yG) z@C-8E?QPynNQ<8f01D`2qexcVEIOU?y}MG)TAE6&VT5`rK8s(4PE;uQ92LTXUQ<>^ ztyQ@=@kRdh@ebUG^Z6NWWIL;_IGJ2ST>$t!$m$qvtj0Qmw8moN6GUV^!QKNK zHBXCtUH8)RY9++gH_TUV4^=-j$t}dD3qsN7GclJ^Zc&(j6&a_!$jCf}%c5ey`pm~1)@{yI3 zTdWyB+*X{JFw#z;PwRr5evb2!ueWF;v`B0HoUu4-(~aL=z;OXUUEtG`_$)Oxw6FKg zEzY`CyKaSBK3xt#8gA|r_|Kehn_HYVBMpEwbn9-fI*!u*eTA1ef8Mkl1=!jV4oYwWYM}i`A>_F4nhmlCIC6WLa zY%;4&@AlnaG11ejl61Jev21|r*m+?Kru3;1tFDl}#!OzUp6c>go4{C|^erwpG*&h6bspUPJag}oOkN2912Y3I?(eRc@U9>z#HPBHC?nps7H5!zP``90!Q1n80jo+B3TWXp!8Pe zwuKuLLI6l3Gv@+QH*Y}2wPLPQ1^EZhT#+Ed8q8Wo z1pTmIBxv14-{l&QVKxAyQF#8Q@NeJwWdKk>?cpiJLkJr+aZ!Me+Cfp!?FWSRf^j2k z73BRR{WSKaMkJ>1Nbx5dan5hg^_}O{Tj6u%iV%#QGz0Q@j{R^Ik)Z*+(YvY2ziBG)?AmJa|JV%4UT$k`hcOg5r9R?5>?o~JzK zJCrj&{i#hG>N7!B4kNX(%igb%kDj0fOQThC-8mtfap82PNRXr1D>lbgg)dYTQ(kbx z`Ee5kXG~Bh+BHQBf|kJEy6(ga%WfhvdQNDuOfQoe377l#ht&DrMGeIsI5C<&ai zWG$|hop2@@q5YDa)_-A?B02W;#fH!%k`daQLEItaJJ8Yf1L%8x;kg?)k)00P-lH+w z)5$QNV6r2$YtnV(4o=0^3{kmaXn*Dm0F*fU(@o)yVVjk|ln8ea6BMy%vZAhW9|wvA z8RoDkVoMEz1d>|5(k0Nw>22ZT){V<3$^C-cN+|~hKt2)){+l-?3m@-$c?-dlzQ)q- zZ)j%n^gerV{|+t}9m1_&&Ly!9$rtG4XX|WQ8`xYzGC~U@nYh~g(z9)bdAl#xH)xd5a=@|qql z|FzEil{P5(@gy!4ek05i$>`E^G~{;pnf6ftpLh$h#W?^#4UkPfa;;?bsIe&kz!+40 zI|6`F2n020)-r`pFaZ38F!S-lJM-o&inOw|66=GMeP@xQU5ghQH{~5Uh~TMTd;I9` z>YhVB`e^EVj*S7JF39ZgNf}A-0DwOcTT63ydN$I3b?yBQtUI*_fae~kPvzoD$zjX3 zoqBe#>12im4WzZ=f^4+u=!lA|#r%1`WB0-6*3BL#at`47#ebPpR|D1b)3BjT34nYY z%Ds%d?5$|{LgOIaRO{{oC&RK`O91$fqwM0(C_TALcozu*fWHb%%q&p-q{_8*2Zsi^ zh1ZCnr^UYa;4vQEtHk{~zi>wwMC5o{S=$P0X681y`SXwFH?Ewn{x-MOZynmc)JT5v zuHLwh;tLfxRrr%|k370}GofLl7thg>ACWWY&msqaVu&ry+`7+Ss>NL^%T1|z{IGMA zW-SKl=V-^{(f!Kf^#3(|T2W47d(%JVCI4JgRrT1pNz>+ietmFToNv^`gzC@&O-)+i zPQ~RwK8%C_vf%;%e>NyTp~dM5;!C|N0Q^6|CEb7Bw=Vz~$1#FA;Z*?mKSC)Hl-20s t8QyHj(g6VK0RYbl8UjE)0O0w=e*@m04r>stuEhWV002ovPDHLkV1hl;dM*F} literal 0 HcmV?d00001 diff --git a/Arduino/libraries/AccelStepper/doc/files.html b/Arduino/libraries/AccelStepper/doc/files.html new file mode 100644 index 0000000..c056fa6 --- /dev/null +++ b/Arduino/libraries/AccelStepper/doc/files.html @@ -0,0 +1,61 @@ + + + + + + +AccelStepper: File List + + + + + + +
+
+ + + + + + +
+
AccelStepper +
+
+
+ + + + +
+
+
+
File List
+
+
+
Here is a list of all documented files with brief descriptions:
+ + +
\*AccelStepper.h
+
+
+ + + + diff --git a/Arduino/libraries/AccelStepper/doc/functions.html b/Arduino/libraries/AccelStepper/doc/functions.html new file mode 100644 index 0000000..919e8e2 --- /dev/null +++ b/Arduino/libraries/AccelStepper/doc/functions.html @@ -0,0 +1,244 @@ + + + + + + +AccelStepper: Class Members + + + + + + +
+
+ + + + + + +
+
AccelStepper +
+
+
+ + + + + + +
+
+
Here is a list of all documented class members with links to the class documentation for each member:
+ +

- a -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- f -

+ + +

- h -

+ + +

- m -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+
+ + + + diff --git a/Arduino/libraries/AccelStepper/doc/functions_func.html b/Arduino/libraries/AccelStepper/doc/functions_func.html new file mode 100644 index 0000000..a2b9672 --- /dev/null +++ b/Arduino/libraries/AccelStepper/doc/functions_func.html @@ -0,0 +1,201 @@ + + + + + + +AccelStepper: Class Members - Functions + + + + + + +
+
+ + + + + + +
+
AccelStepper +
+
+
+ + + + + + +
+
+  + +

- a -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- m -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+
+ + + + diff --git a/Arduino/libraries/AccelStepper/doc/index.html b/Arduino/libraries/AccelStepper/doc/index.html new file mode 100644 index 0000000..d7d18b3 --- /dev/null +++ b/Arduino/libraries/AccelStepper/doc/index.html @@ -0,0 +1,184 @@ + + + + + + +AccelStepper: AccelStepper library for Arduino + + + + + + +
+
+ + + + + + +
+
AccelStepper +
+
+
+ + + +
+
+
+
AccelStepper library for Arduino
+
+
+

This is the Arduino AccelStepper library. It provides an object-oriented interface for 2, 3 or 4 pin stepper motors.

+

The standard Arduino IDE includes the Stepper library (http://arduino.cc/en/Reference/Stepper) for stepper motors. It is perfectly adequate for simple, single motor applications.

+

AccelStepper significantly improves on the standard Arduino Stepper library in several ways:

+
    +
  • Supports acceleration and deceleration
  • +
  • Supports multiple simultaneous steppers, with independent concurrent stepping on each stepper
  • +
  • API functions never delay() or block
  • +
  • Supports 2, 3 and 4 wire steppers, plus 3 and 4 wire half steppers.
  • +
  • Supports alternate stepping functions to enable support of AFMotor (https://github.com/adafruit/Adafruit-Motor-Shield-library)
  • +
  • Supports stepper drivers such as the Sparkfun EasyDriver (based on 3967 driver chip)
  • +
  • Very slow speeds are supported
  • +
  • Extensive API
  • +
  • Subclass support
  • +
+

The latest version of this documentation can be downloaded from http://www.airspayce.com/mikem/arduino/AccelStepper The version of the package that this documentation refers to can be downloaded from http://www.airspayce.com/mikem/arduino/AccelStepper/AccelStepper-1.47.zip

+

Example Arduino programs are included to show the main modes of use.

+

You can also find online help and discussion at http://groups.google.com/group/accelstepper Please use that group for all questions and discussions on this topic. Do not contact the author directly, unless it is to discuss commercial licensing. Before asking a question or reporting a bug, please read http://www.catb.org/esr/faqs/smart-questions.html

+

Tested on Arduino Diecimila and Mega with arduino-0018 & arduino-0021 on OpenSuSE 11.1 and avr-libc-1.6.1-1.15, cross-avr-binutils-2.19-9.1, cross-avr-gcc-4.1.3_20080612-26.5. Tested on Teensy http://www.pjrc.com/teensy including Teensy 3.1 built using Arduino IDE 1.0.5 with teensyduino addon 1.18 and later.

+
Installation
+

Install in the usual way: unzip the distribution zip file to the libraries sub-folder of your sketchbook.

+
Theory
+

This code uses speed calculations as described in "Generate stepper-motor speed profiles in real time" by David Austin http://fab.cba.mit.edu/classes/MIT/961.09/projects/i0/Stepper_Motor_Speed_Profile.pdf with the exception that AccelStepper uses steps per second rather than radians per second (because we dont know the step angle of the motor) An initial step interval is calculated for the first step, based on the desired acceleration On subsequent steps, shorter step intervals are calculated based on the previous step until max speed is achieved.

+
Donations
+

This library is offered under a free GPL license for those who want to use it that way. We try hard to keep it up to date, fix bugs and to provide free support. If this library has helped you save time or money, please consider donating at http://www.airspayce.com or here:

+
Trademarks
+

AccelStepper is a trademark of AirSpayce Pty Ltd. The AccelStepper mark was first used on April 26 2010 for international trade, and is used only in relation to motor control hardware and software. It is not to be confused with any other similar marks covering other goods and services.

+
Copyright
+

This software is Copyright (C) 2010 Mike McCauley. Use is subject to license conditions. The main licensing options available are GPL V2 or Commercial:

+
Open Source Licensing GPL V2
This is the appropriate option if you want to share the source code of your application with everyone you distribute it to, and you also want to give them the right to share who uses it. If you wish to use this software under Open Source Licensing, you must contribute all your source code to the open source community in accordance with the GPL Version 2 when your application is distributed. See http://www.gnu.org/copyleft/gpl.html
+
Commercial Licensing
This is the appropriate option if you are creating proprietary applications and you are not prepared to distribute and share the source code of your application. Contact info@.nosp@m.airs.nosp@m.payce.nosp@m..com for details.
+
Revision History
+
Version
1.0 Initial release
+
+1.1 Added speed() function to get the current speed.
+
+1.2 Added runSpeedToPosition() submitted by Gunnar Arndt.
+
+1.3 Added support for stepper drivers (ie with Step and Direction inputs) with _pins == 1
+
+1.4 Added functional contructor to support AFMotor, contributed by Limor, with example sketches.
+
+1.5 Improvements contributed by Peter Mousley: Use of microsecond steps and other speed improvements to increase max stepping speed to about 4kHz. New option for user to set the min allowed pulse width. Added checks for already running at max speed and skip further calcs if so.
+
+1.6 Fixed a problem with wrapping of microsecond stepping that could cause stepping to hang. Reported by Sandy Noble. Removed redundant _lastRunTime member.
+
+1.7 Fixed a bug where setCurrentPosition() did not always work as expected. Reported by Peter Linhart.
+
+1.8 Added support for 4 pin half-steppers, requested by Harvey Moon
+
+1.9 setCurrentPosition() now also sets motor speed to 0.
+
+1.10 Builds on Arduino 1.0
+
+1.11 Improvments from Michael Ellison: Added optional enable line support for stepper drivers Added inversion for step/direction/enable lines for stepper drivers
+
+1.12 Announce Google Group
+
+1.13 Improvements to speed calculation. Cost of calculation is now less in the worst case, and more or less constant in all cases. This should result in slightly beter high speed performance, and reduce anomalous speed glitches when other steppers are accelerating. However, its hard to see how to replace the sqrt() required at the very first step from 0 speed.
+
+1.14 Fixed a problem with compiling under arduino 0021 reported by EmbeddedMan
+
+1.15 Fixed a problem with runSpeedToPosition which did not correctly handle running backwards to a smaller target position. Added examples
+
+1.16 Fixed some cases in the code where abs() was used instead of fabs().
+
+1.17 Added example ProportionalControl
+
+1.18 Fixed a problem: If one calls the funcion runSpeed() when Speed is zero, it makes steps without counting. reported by Friedrich, Klappenbach.
+
+1.19 Added MotorInterfaceType and symbolic names for the number of pins to use for the motor interface. Updated examples to suit. Replaced individual pin assignment variables _pin1, _pin2 etc with array _pin[4]. _pins member changed to _interface. Added _pinInverted array to simplify pin inversion operations. Added new function setOutputPins() which sets the motor output pins. It can be overridden in order to provide, say, serial output instead of parallel output Some refactoring and code size reduction.
+
+1.20 Improved documentation and examples to show need for correctly specifying AccelStepper::FULL4WIRE and friends.
+
+1.21 Fixed a problem where desiredSpeed could compute the wrong step acceleration when _speed was small but non-zero. Reported by Brian Schmalz. Precompute sqrt_twoa to improve performance and max possible stepping speed
+
+1.22 Added Bounce.pde example Fixed a problem where calling moveTo(), setMaxSpeed(), setAcceleration() more frequently than the step time, even with the same values, would interfere with speed calcs. Now a new speed is computed only if there was a change in the set value. Reported by Brian Schmalz.
+
+1.23 Rewrite of the speed algorithms in line with http://fab.cba.mit.edu/classes/MIT/961.09/projects/i0/Stepper_Motor_Speed_Profile.pdf Now expect smoother and more linear accelerations and decelerations. The desiredSpeed() function was removed.
+
+1.24 Fixed a problem introduced in 1.23: with runToPosition, which did never returned
+
+1.25 Now ignore attempts to set acceleration to 0.0
+
+1.26 Fixed a problem where certina combinations of speed and accelration could cause oscillation about the target position.
+
+1.27 Added stop() function to stop as fast as possible with current acceleration parameters. Also added new Quickstop example showing its use.
+
+1.28 Fixed another problem where certain combinations of speed and accelration could cause oscillation about the target position. Added support for 3 wire full and half steppers such as Hard Disk Drive spindle. Contributed by Yuri Ivatchkovitch.
+
+1.29 Fixed a problem that could cause a DRIVER stepper to continually step with some sketches. Reported by Vadim.
+
+1.30 Fixed a problem that could cause stepper to back up a few steps at the end of accelerated travel with certain speeds. Reported and patched by jolo.
+
+1.31 Updated author and distribution location details to airspayce.com
+
+1.32 Fixed a problem with enableOutputs() and setEnablePin on Arduino Due that prevented the enable pin changing stae correctly. Reported by Duane Bishop.
+
+1.33 Fixed an error in example AFMotor_ConstantSpeed.pde did not setMaxSpeed(); Fixed a problem that caused incorrect pin sequencing of FULL3WIRE and HALF3WIRE. Unfortunately this meant changing the signature for all step*() functions. Added example MotorShield, showing how to use AdaFruit Motor Shield to control a 3 phase motor such as a HDD spindle motor (and without using the AFMotor library.
+
+1.34 Added setPinsInverted(bool pin1Invert, bool pin2Invert, bool pin3Invert, bool pin4Invert, bool enableInvert) to allow inversion of 2, 3 and 4 wire stepper pins. Requested by Oleg.
+
+1.35 Removed default args from setPinsInverted(bool, bool, bool, bool, bool) to prevent ambiguity with setPinsInverted(bool, bool, bool). Reported by Mac Mac.
+
+1.36 Changed enableOutputs() and disableOutputs() to be virtual so can be overridden. Added new optional argument 'enable' to constructor, which allows you toi disable the automatic enabling of outputs at construction time. Suggested by Guido.
+
+1.37 Fixed a problem with step1 that could cause a rogue step in the wrong direction (or not, depending on the setup-time requirements of the connected hardware). Reported by Mark Tillotson.
+
+1.38 run() function incorrectly always returned true. Updated function and doc so it returns true if the motor is still running to the target position.
+
+1.39 Updated typos in keywords.txt, courtesey Jon Magill.
+
+1.40 Updated documentation, including testing on Teensy 3.1
+
+1.41 Fixed an error in the acceleration calculations, resulting in acceleration of haldf the intended value
+
+1.42 Improved support for FULL3WIRE and HALF3WIRE output pins. These changes were in Yuri's original contribution but did not make it into production.
+
+
+1.43 Added DualMotorShield example. Shows how to use AccelStepper to control 2 x 2 phase steppers using the Itead Studio Arduino Dual Stepper Motor Driver Shield model IM120417015.
+
+
+1.44 examples/DualMotorShield/DualMotorShield.ino examples/DualMotorShield/DualMotorShield.pde was missing from the distribution.
+
+
+1.45 Fixed a problem where if setAcceleration was not called, there was no default acceleration. Reported by Michael Newman.
+
+
+1.45 Fixed inaccuracy in acceleration rate by using Equation 15, suggested by Sebastian Gracki.
+ Performance improvements in runSpeed suggested by Jaakko Fagerlund.
+
+
+1.46 Fixed error in documentation for runToPosition(). Reinstated time calculations in runSpeed() since new version is reported not to work correctly under some circumstances. Reported by Oleg V Gavva.
+
+
+ + + + diff --git a/Arduino/libraries/AccelStepper/doc/tab_b.gif b/Arduino/libraries/AccelStepper/doc/tab_b.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d623483ffdf5f9f96900108042a7ab0643fe2a3 GIT binary patch literal 35 ncmZ?wbhEHbWMp7uXkcJy*>IeJfk6j|fqX^=1|}vKMh0sDa2W*H literal 0 HcmV?d00001 diff --git a/Arduino/libraries/AccelStepper/doc/tab_l.gif b/Arduino/libraries/AccelStepper/doc/tab_l.gif new file mode 100644 index 0000000000000000000000000000000000000000..9b1e6337c9299a700401a2a78a2c6ffced475216 GIT binary patch literal 706 zcmZ?wbhEHbZT`}F1e&(Gg}Y(8=I;HA5#Z$3JI=gGB)FQ#odI(O&E^@q;x zK6mr*m3xOS-#u~t!I@i+u0DKm^U160k6t`|^WpV}&n+8{U%dD9&a>B#U%!9-@yol< zU%&tQ{rk_K|NsC0`}dE5ET99@1@a36+kb~?0UJ*yc&I3X_m z!ND^5$O7$#8OFRuDhG}!?8z?cdZK&!`PWjdR;Aj^wZ` zeK{IEYHBJ)6K8VIp1`BVt++swf6j+=L{p1*nO(VhE`pFexG@5$|>uaCcd z`0m=9m+yak{QmXN#Sc$^{$X9h9&q2jiKAI|&T)a;PPx2K9p`YIdw8HtR5k2Q$2-O2 z*;3y{MQ-RnJTgJfI&R5|O)AHxDf_00XbPvDZPy4t=hHd)nfLPvms&O`Ok(sD()5v$ z5U@&h;a=#xbxVbo2~X&Xj0Ie(f{v>vERH+qC+nTG=B8Nca=wU-O$?1&vUgV~9=!H; zx>3p9Yn%*<>t~sk+&0xfyS8RsPfYBd<~wWK%j-LmpU>O7yX^h#UCp1x-p#i7@bE;py8XI6 zmY<)m>~)W~yIWcMVoiPg{duuf<*)9qZ9l$m*Ph&W&$jlv*Vpa+{pH@n=IQ$L?0$ax ec60Ul|8o2P|NVbd{6P)#weSbE3}s?04AuZvx_~SI literal 0 HcmV?d00001 diff --git a/Arduino/libraries/AccelStepper/doc/tab_r.gif b/Arduino/libraries/AccelStepper/doc/tab_r.gif new file mode 100644 index 0000000000000000000000000000000000000000..ce9dd9f533cb5486d6941844f442b59d4a9e9175 GIT binary patch literal 2585 zcmbV}`9Bkk1ILFF--w5zJc=ZZT(zjE=;2|_S)Qm~rCWz1Pc)KPl;jv%A#&v2*x}yc zmf2~Jm~&=xjJY?PqwIN}f8qQ2{r$uH{c*nJbmr{cR5??*egHrs-B=MzCF`3%e{FAW z{oL5xTHn~5TM{jaB;@|_Ue5F&Zb@p(kMyG{*;gWDg zyeL|eZf7Qd8=#bXzSiR{yzRgLSj-fJS8>lBjVHN z^o-0eS=nE6a`W;LChBs=`+QAJP~{b93>H^eRb5kCSC1zUNezun%`L5M?RDzv#%jk7 zYVRX=vATPD`+oEfum^{RM@GjuP?-r=yh0!p;Vx^T9G7~`7%5ydH%70=jyJ;;`d;hv92x3R=z{xp+Lg2!*@OK*K15-t&okoPtSED)h&$RLxdbA zseWm^C3d%-yRNi-ryk^!ek+C`n&~cd$#ZWct_cUL{l~i+Nzx^5d!n94(>bW-iL~Rl z&8r)?q|1DIo=0=judQ{FaGcfLERz8gfn3-Qt<2lksh{mzpT}DXxUuR^z=^key&q4! z+wWI45vL0k$R^(F#{qfqhUsN@WA+w-V?LPH33!Q?WFSB3)WBojE@hK41Nb?KfS+Qo zXgrzfsP$wr4Qzy*{OD>uJBjdgGM@VMml5)2f~_}lD*YyOb}Hjeobhz#4c`w(l^>KK zr?Ud;W~Z}*w;%hZ|2^p^+f06gJDJQD zeIhGADbDmm&6arh(q>EZ<7mjzg7l|z$hRL8=1>)Nv=S7CY$B}iYJ&*T_-T_OG*L1q ztZ3Lana33?y3AKnyq^YCF|4x%Rb5WU&2qcl{TFKey%QJeMxn^SdT!hZ5+0i1zeusiYVp-phBl7b5+Px-X&LhByq z0F&<;K0l2+v>qiHlXb#$jXMv$uK-dEGE9L~qtdU(XeRXmvu*K2Q&6!fD**JxYP4b4BR7FdJ$Qx9G9`J%-_X!a#LGpp3g9)VWytGCa;7`S1_e8F~!R+aSJ zOF17p2`H?2kPs8Q`_;U}+D%3p zs2-0BTqFwpUoBk`?P;iPQ(IbEA|JmMx!P&YYG|R@S=5Mnw;-?A6rEEVyV%d7{iU4a zNk`i!%F(Ykpm`}#oH;BjY->@b8vQedv;pza2FL&*6ufjd+*3Ute&>kes~TU?^KkojsTh(o~(3tk1Y6>4(yn( z#U*ID9@eg-beKo1B;HXe+}{Z%n@7m0+yxivuqk9~;!1LGQlah)xYK4>wgL}l6dsaN zIxlRlq`*`j9PG4*0hD6YV_b_2w5b#)o7J?`q#{GjvvKlD`T*dWcZx<-s(ZvLB44E# z=!|sw!?)@%y$oRNL#25WS3lzdii}TuQ3?CLnvQ1_n};2sT_;Y;#d3=+-(O% zMN$>O!3;ke(UuLR%h_&)N zs^!-@A>QR}4yB1bPp`9S19ikTbZ~O{&FF-yHK{En;mmShDUIEw03`j(DBIsM}Rjki2J#SQa3gFZTKBPDeIiLt9Z z%bL3(B@Qw%(B`wSMS~dPh$=R`(}lBoFXKy(s|*{#ru$wjsBc_O#zxNk9w+UUHmx(U zmJ8+M+ndtnZ<7|VU9Mbt61zpo9T&3%Wx&XII=#QJxjR`CZf22ac3d51Z?GD%LEe_&*t46Qf;4`bZ7p2K(Ab5>GfT^}4! zBT&HZD`^PEgWoI&{~o-ID0F?O`75sm(87x%A{(}Ch1)QlzdJ)1B-eqe5a(weg0`4lQIf1evjvbBY50DVbzO7CLf|vP z2#0(U-|jZ`H{y5N^o7%iK6H>_HEGN->U6^!)1{XpJV!!4(Ig7wzZQ*9WYF4X1rG0x z=1uA@i`rIAciubDC{;~b(|&|A@xkjRP5aRcvRU9tvIm}jDB6J eQ0-6-y)mpwdT=ayS0tBxKDA*~;EWmo literal 0 HcmV?d00001 diff --git a/Arduino/libraries/AccelStepper/doc/tabs.css b/Arduino/libraries/AccelStepper/doc/tabs.css new file mode 100644 index 0000000..9cf578f --- /dev/null +++ b/Arduino/libraries/AccelStepper/doc/tabs.css @@ -0,0 +1,60 @@ +.tabs, .tabs2, .tabs3 { + background-image: url('tab_b.png'); + width: 100%; + z-index: 101; + font-size: 13px; + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +} + +.tabs2 { + font-size: 10px; +} +.tabs3 { + font-size: 9px; +} + +.tablist { + margin: 0; + padding: 0; + display: table; +} + +.tablist li { + float: left; + display: table-cell; + background-image: url('tab_b.png'); + line-height: 36px; + list-style: none; +} + +.tablist a { + display: block; + padding: 0 20px; + font-weight: bold; + background-image:url('tab_s.png'); + background-repeat:no-repeat; + background-position:right; + color: #283A5D; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; + outline: none; +} + +.tabs3 .tablist a { + padding: 0 10px; +} + +.tablist a:hover { + background-image: url('tab_h.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); + text-decoration: none; +} + +.tablist li.current a { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} diff --git a/Arduino/libraries/AccelStepper/examples/AFMotor_ConstantSpeed/AFMotor_ConstantSpeed.pde b/Arduino/libraries/AccelStepper/examples/AFMotor_ConstantSpeed/AFMotor_ConstantSpeed.pde new file mode 100644 index 0000000..3358a20 --- /dev/null +++ b/Arduino/libraries/AccelStepper/examples/AFMotor_ConstantSpeed/AFMotor_ConstantSpeed.pde @@ -0,0 +1,36 @@ +// AFMotor_ConstantSpeed.pde +// -*- mode: C++ -*- +// +// Shows how to run AccelStepper in the simplest, +// fixed speed mode with no accelerations +// Requires the AFMotor library (https://github.com/adafruit/Adafruit-Motor-Shield-library) + +#include +#include + +AF_Stepper motor1(200, 1); + + +// you can change these to DOUBLE or INTERLEAVE or MICROSTEP! +void forwardstep() { + motor1.onestep(FORWARD, SINGLE); +} +void backwardstep() { + motor1.onestep(BACKWARD, SINGLE); +} + +AccelStepper stepper(forwardstep, backwardstep); // use functions to step + +void setup() +{ + Serial.begin(9600); // set up Serial library at 9600 bps + Serial.println("Stepper test!"); + + stepper.setMaxSpeed(50); + stepper.setSpeed(50); +} + +void loop() +{ + stepper.runSpeed(); +} diff --git a/Arduino/libraries/AccelStepper/examples/AFMotor_MultiStepper/AFMotor_MultiStepper.pde b/Arduino/libraries/AccelStepper/examples/AFMotor_MultiStepper/AFMotor_MultiStepper.pde new file mode 100644 index 0000000..8e86bbc --- /dev/null +++ b/Arduino/libraries/AccelStepper/examples/AFMotor_MultiStepper/AFMotor_MultiStepper.pde @@ -0,0 +1,54 @@ +// AFMotor_MultiStepper.pde +// -*- mode: C++ -*- +// +// Control both Stepper motors at the same time with different speeds +// and accelerations. +// Requires the AFMotor library (https://github.com/adafruit/Adafruit-Motor-Shield-library) + +#include +#include + +// two stepper motors one on each port +AF_Stepper motor1(200, 1); +AF_Stepper motor2(200, 2); + +// you can change these to DOUBLE or INTERLEAVE or MICROSTEP! +// wrappers for the first motor! +void forwardstep1() { + motor1.onestep(FORWARD, SINGLE); +} +void backwardstep1() { + motor1.onestep(BACKWARD, SINGLE); +} +// wrappers for the second motor! +void forwardstep2() { + motor2.onestep(FORWARD, SINGLE); +} +void backwardstep2() { + motor2.onestep(BACKWARD, SINGLE); +} + +// Motor shield has two motor ports, now we'll wrap them in an AccelStepper object +AccelStepper stepper1(forwardstep1, backwardstep1); +AccelStepper stepper2(forwardstep2, backwardstep2); + +void setup() +{ + stepper1.setMaxSpeed(200.0); + stepper1.setAcceleration(100.0); + stepper1.moveTo(24); + + stepper2.setMaxSpeed(300.0); + stepper2.setAcceleration(100.0); + stepper2.moveTo(1000000); + +} + +void loop() +{ + // Change direction at the limits + if (stepper1.distanceToGo() == 0) + stepper1.moveTo(-stepper1.currentPosition()); + stepper1.run(); + stepper2.run(); +} diff --git a/Arduino/libraries/AccelStepper/examples/Blocking/Blocking.pde b/Arduino/libraries/AccelStepper/examples/Blocking/Blocking.pde new file mode 100644 index 0000000..f91b34e --- /dev/null +++ b/Arduino/libraries/AccelStepper/examples/Blocking/Blocking.pde @@ -0,0 +1,28 @@ +// Blocking.pde +// -*- mode: C++ -*- +// +// Shows how to use the blocking call runToNewPosition +// Which sets a new target position and then waits until the stepper has +// achieved it. +// +// Copyright (C) 2009 Mike McCauley +// $Id: Blocking.pde,v 1.1 2011/01/05 01:51:01 mikem Exp mikem $ + +#include + +// Define a stepper and the pins it will use +AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5 + +void setup() +{ + stepper.setMaxSpeed(200.0); + stepper.setAcceleration(100.0); +} + +void loop() +{ + stepper.runToNewPosition(0); + stepper.runToNewPosition(500); + stepper.runToNewPosition(100); + stepper.runToNewPosition(120); +} diff --git a/Arduino/libraries/AccelStepper/examples/Bounce/Bounce.pde b/Arduino/libraries/AccelStepper/examples/Bounce/Bounce.pde new file mode 100644 index 0000000..6073c53 --- /dev/null +++ b/Arduino/libraries/AccelStepper/examples/Bounce/Bounce.pde @@ -0,0 +1,29 @@ +// Bounce.pde +// -*- mode: C++ -*- +// +// Make a single stepper bounce from one limit to another +// +// Copyright (C) 2012 Mike McCauley +// $Id: Random.pde,v 1.1 2011/01/05 01:51:01 mikem Exp mikem $ + +#include + +// Define a stepper and the pins it will use +AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5 + +void setup() +{ + // Change these to suit your stepper if you want + stepper.setMaxSpeed(100); + stepper.setAcceleration(20); + stepper.moveTo(500); +} + +void loop() +{ + // If at the end of travel go to the other end + if (stepper.distanceToGo() == 0) + stepper.moveTo(-stepper.currentPosition()); + + stepper.run(); +} diff --git a/Arduino/libraries/AccelStepper/examples/ConstantSpeed/ConstantSpeed.pde b/Arduino/libraries/AccelStepper/examples/ConstantSpeed/ConstantSpeed.pde new file mode 100644 index 0000000..8aef26d --- /dev/null +++ b/Arduino/libraries/AccelStepper/examples/ConstantSpeed/ConstantSpeed.pde @@ -0,0 +1,23 @@ +// ConstantSpeed.pde +// -*- mode: C++ -*- +// +// Shows how to run AccelStepper in the simplest, +// fixed speed mode with no accelerations +/// \author Mike McCauley (mikem@airspayce.com) +// Copyright (C) 2009 Mike McCauley +// $Id: ConstantSpeed.pde,v 1.1 2011/01/05 01:51:01 mikem Exp mikem $ + +#include + +AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5 + +void setup() +{ + stepper.setMaxSpeed(1000); + stepper.setSpeed(50); +} + +void loop() +{ + stepper.runSpeed(); +} diff --git a/Arduino/libraries/AccelStepper/examples/DualMotorShield/DualMotorShield.pde b/Arduino/libraries/AccelStepper/examples/DualMotorShield/DualMotorShield.pde new file mode 100644 index 0000000..1ca70b1 --- /dev/null +++ b/Arduino/libraries/AccelStepper/examples/DualMotorShield/DualMotorShield.pde @@ -0,0 +1,49 @@ +// DualMotorShield.pde +// -*- mode: C++ -*- +// +// Shows how to run 2 simultaneous steppers +// using the Itead Studio Arduino Dual Stepper Motor Driver Shield +// model IM120417015 +// This shield is capable of driving 2 steppers at +// currents of up to 750mA +// and voltages up to 30V +// Runs both steppers forwards and backwards, accelerating and decelerating +// at the limits. +// +// Copyright (C) 2014 Mike McCauley +// $Id: $ + +#include + +// The X Stepper pins +#define STEPPER1_DIR_PIN 3 +#define STEPPER1_STEP_PIN 2 +// The Y stepper pins +#define STEPPER2_DIR_PIN 7 +#define STEPPER2_STEP_PIN 6 + +// Define some steppers and the pins the will use +AccelStepper stepper1(AccelStepper::DRIVER, STEPPER1_STEP_PIN, STEPPER1_DIR_PIN); +AccelStepper stepper2(AccelStepper::DRIVER, STEPPER2_STEP_PIN, STEPPER2_DIR_PIN); + +void setup() +{ + stepper1.setMaxSpeed(200.0); + stepper1.setAcceleration(200.0); + stepper1.moveTo(100); + + stepper2.setMaxSpeed(100.0); + stepper2.setAcceleration(100.0); + stepper2.moveTo(100); +} + +void loop() +{ + // Change direction at the limits + if (stepper1.distanceToGo() == 0) + stepper1.moveTo(-stepper1.currentPosition()); + if (stepper2.distanceToGo() == 0) + stepper2.moveTo(-stepper2.currentPosition()); + stepper1.run(); + stepper2.run(); +} diff --git a/Arduino/libraries/AccelStepper/examples/MotorShield/MotorShield.pde b/Arduino/libraries/AccelStepper/examples/MotorShield/MotorShield.pde new file mode 100644 index 0000000..8018ed1 --- /dev/null +++ b/Arduino/libraries/AccelStepper/examples/MotorShield/MotorShield.pde @@ -0,0 +1,103 @@ +// AFMotor_ConstantSpeed.pde +// -*- mode: C++ -*- +// +// Shows how to use AccelStepper to control a 3-phase motor, such as a HDD spindle motor +// using the Adafruit Motor Shield +// http://www.ladyada.net/make/mshield/index.html. +// Create a subclass of AccelStepper which controls the motor pins via the +// Motor Shield serial-to-parallel interface + +#include + +// Arduino pin names for interface to 74HCT595 latch +// on Adafruit Motor Shield +#define MOTORLATCH 12 +#define MOTORCLK 4 +#define MOTORENABLE 7 +#define MOTORDATA 8 + +// PWM pins, also used to enable motor outputs +#define PWM0A 5 +#define PWM0B 6 +#define PWM1A 9 +#define PWM1B 10 +#define PWM2A 11 +#define PWM2B 3 + + +// The main purpose of this class is to override setOutputPins to work with Adafruit Motor Shield +class AFMotorShield : public AccelStepper +{ + public: + AFMotorShield(uint8_t interface = AccelStepper::FULL4WIRE, uint8_t pin1 = 2, uint8_t pin2 = 3, uint8_t pin3 = 4, uint8_t pin4 = 5); + + virtual void setOutputPins(uint8_t mask); +}; + + +AFMotorShield::AFMotorShield(uint8_t interface, uint8_t pin1, uint8_t pin2, uint8_t pin3, uint8_t pin4) + : AccelStepper(interface, pin1, pin2, pin3, pin4) +{ + // Enable motor control serial to parallel latch + pinMode(MOTORLATCH, OUTPUT); + pinMode(MOTORENABLE, OUTPUT); + pinMode(MOTORDATA, OUTPUT); + pinMode(MOTORCLK, OUTPUT); + digitalWrite(MOTORENABLE, LOW); + + // enable both H bridges on motor 1 + pinMode(PWM2A, OUTPUT); + pinMode(PWM2B, OUTPUT); + pinMode(PWM0A, OUTPUT); + pinMode(PWM0B, OUTPUT); + digitalWrite(PWM2A, HIGH); + digitalWrite(PWM2B, HIGH); + digitalWrite(PWM0A, HIGH); + digitalWrite(PWM0B, HIGH); + + setOutputPins(0); // Reset +}; + +// Use the AF Motor Shield serial-to-parallel to set the state of the motor pins +// Caution: the mapping of AccelStepper pins to AF motor outputs is not +// obvious: +// AccelStepper Motor Shield output +// pin1 M4A +// pin2 M1A +// pin3 M2A +// pin4 M3A +// Caution this is pretty slow and limits the max speed of the motor to about 500/3 rpm +void AFMotorShield::setOutputPins(uint8_t mask) +{ + uint8_t i; + + digitalWrite(MOTORLATCH, LOW); + digitalWrite(MOTORDATA, LOW); + + for (i=0; i<8; i++) + { + digitalWrite(MOTORCLK, LOW); + + if (mask & _BV(7-i)) + digitalWrite(MOTORDATA, HIGH); + else + digitalWrite(MOTORDATA, LOW); + + digitalWrite(MOTORCLK, HIGH); + } + digitalWrite(MOTORLATCH, HIGH); +} + +AFMotorShield stepper(AccelStepper::HALF3WIRE, 0, 0, 0, 0); // 3 phase HDD spindle drive + +void setup() +{ + stepper.setMaxSpeed(500); // divide by 3 to get rpm + stepper.setAcceleration(80); + stepper.moveTo(10000000); +} + +void loop() +{ + stepper.run(); +} diff --git a/Arduino/libraries/AccelStepper/examples/MultiStepper/MultiStepper.pde b/Arduino/libraries/AccelStepper/examples/MultiStepper/MultiStepper.pde new file mode 100644 index 0000000..242e9f5 --- /dev/null +++ b/Arduino/libraries/AccelStepper/examples/MultiStepper/MultiStepper.pde @@ -0,0 +1,41 @@ +// MultiStepper.pde +// -*- mode: C++ -*- +// +// Shows how to multiple simultaneous steppers +// Runs one stepper forwards and backwards, accelerating and decelerating +// at the limits. Runs other steppers at the same time +// +// Copyright (C) 2009 Mike McCauley +// $Id: MultiStepper.pde,v 1.1 2011/01/05 01:51:01 mikem Exp mikem $ + +#include + +// Define some steppers and the pins the will use +AccelStepper stepper1; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5 +AccelStepper stepper2(AccelStepper::FULL4WIRE, 6, 7, 8, 9); +AccelStepper stepper3(AccelStepper::FULL2WIRE, 10, 11); + +void setup() +{ + stepper1.setMaxSpeed(200.0); + stepper1.setAcceleration(100.0); + stepper1.moveTo(24); + + stepper2.setMaxSpeed(300.0); + stepper2.setAcceleration(100.0); + stepper2.moveTo(1000000); + + stepper3.setMaxSpeed(300.0); + stepper3.setAcceleration(100.0); + stepper3.moveTo(1000000); +} + +void loop() +{ + // Change direction at the limits + if (stepper1.distanceToGo() == 0) + stepper1.moveTo(-stepper1.currentPosition()); + stepper1.run(); + stepper2.run(); + stepper3.run(); +} diff --git a/Arduino/libraries/AccelStepper/examples/Overshoot/Overshoot.pde b/Arduino/libraries/AccelStepper/examples/Overshoot/Overshoot.pde new file mode 100644 index 0000000..7e16baf --- /dev/null +++ b/Arduino/libraries/AccelStepper/examples/Overshoot/Overshoot.pde @@ -0,0 +1,28 @@ +// Overshoot.pde +// -*- mode: C++ -*- +// +// Check overshoot handling +// which sets a new target position and then waits until the stepper has +// achieved it. This is used for testing the handling of overshoots +// +// Copyright (C) 2009 Mike McCauley +// $Id: Overshoot.pde,v 1.1 2011/01/05 01:51:01 mikem Exp mikem $ + +#include + +// Define a stepper and the pins it will use +AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5 + +void setup() +{ + stepper.setMaxSpeed(150); + stepper.setAcceleration(100); +} + +void loop() +{ + stepper.moveTo(500); + while (stepper.currentPosition() != 300) // Full speed up to 300 + stepper.run(); + stepper.runToNewPosition(0); // Cause an overshoot then back to 0 +} diff --git a/Arduino/libraries/AccelStepper/examples/ProportionalControl/ProportionalControl.pde b/Arduino/libraries/AccelStepper/examples/ProportionalControl/ProportionalControl.pde new file mode 100644 index 0000000..2afe444 --- /dev/null +++ b/Arduino/libraries/AccelStepper/examples/ProportionalControl/ProportionalControl.pde @@ -0,0 +1,32 @@ +// ProportionalControl.pde +// -*- mode: C++ -*- +// +// Make a single stepper follow the analog value read from a pot or whatever +// The stepper will move at a constant speed to each newly set posiiton, +// depending on the value of the pot. +// +// Copyright (C) 2012 Mike McCauley +// $Id: ProportionalControl.pde,v 1.1 2011/01/05 01:51:01 mikem Exp mikem $ + +#include + +// Define a stepper and the pins it will use +AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5 + +// This defines the analog input pin for reading the control voltage +// Tested with a 10k linear pot between 5v and GND +#define ANALOG_IN A0 + +void setup() +{ + stepper.setMaxSpeed(1000); +} + +void loop() +{ + // Read new position + int analog_in = analogRead(ANALOG_IN); + stepper.moveTo(analog_in); + stepper.setSpeed(100); + stepper.runSpeedToPosition(); +} diff --git a/Arduino/libraries/AccelStepper/examples/Quickstop/Quickstop.pde b/Arduino/libraries/AccelStepper/examples/Quickstop/Quickstop.pde new file mode 100644 index 0000000..e6cfd44 --- /dev/null +++ b/Arduino/libraries/AccelStepper/examples/Quickstop/Quickstop.pde @@ -0,0 +1,40 @@ +// Quickstop.pde +// -*- mode: C++ -*- +// +// Check stop handling. +// Calls stop() while the stepper is travelling at full speed, causing +// the stepper to stop as quickly as possible, within the constraints of the +// current acceleration. +// +// Copyright (C) 2012 Mike McCauley +// $Id: $ + +#include + +// Define a stepper and the pins it will use +AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5 + +void setup() +{ + stepper.setMaxSpeed(150); + stepper.setAcceleration(100); +} + +void loop() +{ + stepper.moveTo(500); + while (stepper.currentPosition() != 300) // Full speed up to 300 + stepper.run(); + stepper.stop(); // Stop as fast as possible: sets new target + stepper.runToPosition(); + // Now stopped after quickstop + + // Now go backwards + stepper.moveTo(-500); + while (stepper.currentPosition() != 0) // Full speed basck to 0 + stepper.run(); + stepper.stop(); // Stop as fast as possible: sets new target + stepper.runToPosition(); + // Now stopped after quickstop + +} diff --git a/Arduino/libraries/AccelStepper/examples/Random/Random.pde b/Arduino/libraries/AccelStepper/examples/Random/Random.pde new file mode 100644 index 0000000..871d361 --- /dev/null +++ b/Arduino/libraries/AccelStepper/examples/Random/Random.pde @@ -0,0 +1,30 @@ +// Random.pde +// -*- mode: C++ -*- +// +// Make a single stepper perform random changes in speed, position and acceleration +// +// Copyright (C) 2009 Mike McCauley +// $Id: Random.pde,v 1.1 2011/01/05 01:51:01 mikem Exp mikem $ + +#include + +// Define a stepper and the pins it will use +AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5 + +void setup() +{ +} + +void loop() +{ + if (stepper.distanceToGo() == 0) + { + // Random change to speed, position and acceleration + // Make sure we dont get 0 speed or accelerations + delay(1000); + stepper.moveTo(rand() % 200); + stepper.setMaxSpeed((rand() % 200) + 1); + stepper.setAcceleration((rand() % 200) + 1); + } + stepper.run(); +} diff --git a/Arduino/libraries/AccelStepper/keywords.txt b/Arduino/libraries/AccelStepper/keywords.txt new file mode 100644 index 0000000..940f611 --- /dev/null +++ b/Arduino/libraries/AccelStepper/keywords.txt @@ -0,0 +1,40 @@ +####################################### +# Syntax Coloring Map For AccelStepper +####################################### + +####################################### +# Datatypes (KEYWORD1) +####################################### + +AccelStepper KEYWORD1 + +####################################### +# Methods and Functions (KEYWORD2) +####################################### + +moveTo KEYWORD2 +move KEYWORD2 +run KEYWORD2 +runSpeed KEYWORD2 +setMaxSpeed KEYWORD2 +setAcceleration KEYWORD2 +setSpeed KEYWORD2 +speed KEYWORD2 +distanceToGo KEYWORD2 +targetPosition KEYWORD2 +currentPosition KEYWORD2 +setCurrentPosition KEYWORD2 +runToPosition KEYWORD2 +runSpeedToPosition KEYWORD2 +runToNewPosition KEYWORD2 +stop KEYWORD2 +disableOutputs KEYWORD2 +enableOutputs KEYWORD2 +setMinPulseWidth KEYWORD2 +setEnablePin KEYWORD2 +setPinsInverted KEYWORD2 + +####################################### +# Constants (LITERAL1) +####################################### + diff --git a/Arduino/libraries/AccelStepper/project.cfg b/Arduino/libraries/AccelStepper/project.cfg new file mode 100644 index 0000000..0d20fb8 --- /dev/null +++ b/Arduino/libraries/AccelStepper/project.cfg @@ -0,0 +1,290 @@ +# Doxyfile 1.8.2 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = AccelStepper +PROJECT_NUMBER = +PROJECT_BRIEF = +PROJECT_LOGO = +OUTPUT_DIRECTORY = +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +TCL_SUBST = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +EXTENSION_MAPPING = +MARKDOWN_SUPPORT = YES +AUTOLINK_SUPPORT = YES +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +INLINE_GROUPED_CLASSES = NO +INLINE_SIMPLE_STRUCTS = NO +TYPEDEF_HIDES_STRUCT = NO +SYMBOL_CACHE_SIZE = 0 +LOOKUP_CACHE_SIZE = 0 +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_PACKAGE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +EXTRACT_ANON_NSPACES = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +FORCE_LOCAL_INCLUDES = NO +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_MEMBERS_CTORS_1ST = NO +SORT_GROUP_NAMES = NO +SORT_BY_SCOPE_NAME = NO +STRICT_PROTO_MATCHING = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_FILES = YES +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +LAYOUT_FILE = +CITE_BIB_FILES = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = +RECURSIVE = NO +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = examples +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = YES +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +FILTER_SOURCE_PATTERNS = +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = NO +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = doc +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_EXTRA_STYLESHEET = +HTML_EXTRA_FILES = +HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_SAT = 100 +HTML_COLORSTYLE_GAMMA = 80 +HTML_TIMESTAMP = NO +HTML_DYNAMIC_SECTIONS = NO +HTML_INDEX_NUM_ENTRIES = 100 +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_BUNDLE_ID = org.doxygen.Project +DOCSET_PUBLISHER_ID = org.doxygen.Publisher +DOCSET_PUBLISHER_NAME = Publisher +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +CHM_INDEX_ENCODING = +BINARY_TOC = NO +TOC_EXPAND = NO +GENERATE_QHP = NO +QCH_FILE = +QHP_NAMESPACE = org.doxygen.Project +QHP_VIRTUAL_FOLDER = doc +QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = +QHG_LOCATION = +GENERATE_ECLIPSEHELP = NO +ECLIPSE_DOC_ID = org.doxygen.Project +DISABLE_INDEX = NO +GENERATE_TREEVIEW = NO +ENUM_VALUES_PER_LINE = 4 +TREEVIEW_WIDTH = 250 +EXT_LINKS_IN_WINDOW = NO +FORMULA_FONTSIZE = 10 +FORMULA_TRANSPARENT = YES +USE_MATHJAX = NO +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest +MATHJAX_EXTENSIONS = +SEARCHENGINE = NO +SERVER_BASED_SEARCH = NO +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +LATEX_FOOTER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +LATEX_SOURCE_CODE = NO +LATEX_BIB_STYLE = plain +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +MSCGEN_PATH = +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +DOT_NUM_THREADS = 0 +DOT_FONTNAME = Helvetica +DOT_FONTSIZE = 10 +DOT_FONTPATH = +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +UML_LIMIT_NUM_FIELDS = 10 +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +INTERACTIVE_SVG = NO +DOT_PATH = +DOTFILE_DIRS = +MSCFILE_DIRS = +DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES