Browse Source

added currently available boards

master
Holger Frey 7 years ago
parent
commit
f8acdee5cf
  1. BIN
      components/Optocoupler CNY17.pdf
  2. 350
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/AccelStepper.cpp
  3. 339
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/AccelStepper.h
  4. 17
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/LICENSE
  5. 27
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/MANIFEST
  6. 26
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/Makefile
  7. 1
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/README.txt
  8. 336
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/AccelStepper_8h-source.html
  9. 32
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/annotated.html
  10. 54
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/classAccelStepper-members.html
  11. 723
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/classAccelStepper.html
  12. 473
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/doxygen.css
  13. BIN
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/doxygen.png
  14. 26
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/files.html
  15. 87
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/functions.html
  16. 87
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/functions_func.html
  17. 51
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/index.html
  18. BIN
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/tab_b.gif
  19. BIN
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/tab_l.gif
  20. BIN
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/tab_r.gif
  21. 102
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/tabs.css
  22. 37
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/examples/AFMotor_ConstantSpeed/AFMotor_ConstantSpeed.pde
  23. 56
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/examples/AFMotor_MultiStepper/AFMotor_MultiStepper.pde
  24. 28
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/examples/Blocking/Blocking.pde
  25. 22
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/examples/ConstantSpeed/ConstantSpeed.pde
  26. 41
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/examples/MultiStepper/MultiStepper.pde
  27. 31
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/examples/Overshoot/Overshoot.pde
  28. 30
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/examples/Random/Random.pde
  29. 1294
      shields/Adafruit Motor Shield v2.3/AccelStepper Library/project.cfg
  30. 398
      shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/Adafruit_MotorShield.cpp
  31. 102
      shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/Adafruit_MotorShield.h
  32. 47
      shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/README.md
  33. 52
      shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/examples/Accel_ConstantSpeed/Accel_ConstantSpeed.ino
  34. 90
      shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/examples/Accel_MultiStepper/Accel_MultiStepper.ino
  35. 68
      shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/examples/DCMotorTest/DCMotorTest.ino
  36. 84
      shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/examples/MotorParty/MotorParty.ino
  37. 76
      shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/examples/StackingTest/StackingTest.ino
  38. 51
      shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/examples/StepperTest/StepperTest.ino
  39. 40
      shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/keywords.txt
  40. 9
      shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/library.properties
  41. 25
      shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/license.txt
  42. 113
      shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/utility/Adafruit_MS_PWMServoDriver.cpp
  43. 61
      shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/utility/Adafruit_MS_PWMServoDriver.h
  44. 26
      shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/utility/license.txt
  45. BIN
      shields/Adafruit Motor Shield v2.3/Data Sheet Motor Driver TB6612FNG.pdf
  46. BIN
      shields/Adafruit Motor Shield v2.3/Motor Shield Schematics.png
  47. 13
      shields/Adafruit Motor Shield v2.3/readme.md
  48. BIN
      shields/Data Logger Shield mSD/mSD-Shield_v20.pdf
  49. 28
      shields/Data Logger Shield mSD/mSD_Shield Library/README.md
  50. 113
      shields/Data Logger Shield mSD/mSD_Shield Library/examples/BMPDemo/BMPDemo.ino
  51. BIN
      shields/Data Logger Shield mSD/mSD_Shield Library/examples/BMPDemo/image.bmp
  52. 93
      shields/Data Logger Shield mSD/mSD_Shield Library/examples/DataLogger/DataLogger.ino
  53. 79
      shields/Data Logger Shield mSD/mSD_Shield Library/examples/RTC/RTC.ino
  54. 96
      shields/Data Logger Shield mSD/mSD_Shield Library/examples/ReadWrite/ReadWrite.ino
  55. 13
      shields/Data Logger Shield mSD/mSD_Shield Library/library.json
  56. 9
      shields/Data Logger Shield mSD/mSD_Shield Library/library.properties
  57. 1
      shields/Data Logger Shield mSD/mSD_Shield Library/mSD_Shield.h
  58. 230
      shields/Real Time Clock RV 8523 Breakout/RV8523 Library/RV8523.cpp
  59. 29
      shields/Real Time Clock RV 8523 Breakout/RV8523 Library/RV8523.h
  60. 75
      shields/Real Time Clock RV 8523 Breakout/RV8523 Library/examples/Example/Example.ino
  61. 150
      shields/Real Time Clock RV 8523 Breakout/RV8523 Library/examples/SetClock/SetClock.ino
  62. 13
      shields/Real Time Clock RV 8523 Breakout/RV8523 Library/library.json
  63. 9
      shields/Real Time Clock RV 8523 Breakout/RV8523 Library/library.properties
  64. BIN
      shields/Real Time Clock RV 8523 Breakout/RV8523-RTC-Breakout_v10.pdf
  65. BIN
      shields/Seeeed Studio Relay Shield v3/img/High_Level_Control3.jpg
  66. BIN
      shields/Seeeed Studio Relay Shield v3/img/Low_Level_Control4.jpg
  67. BIN
      shields/Seeeed Studio Relay Shield v3/img/Motor-shield-schematic-drawing.png
  68. BIN
      shields/Seeeed Studio Relay Shield v3/img/Relay_Shield_Connector.jpg
  69. BIN
      shields/Seeeed Studio Relay Shield v3/img/Relay_Shield_L_v3.0.jpg
  70. BIN
      shields/Seeeed Studio Relay Shield v3/img/Relay_Shield_v3.0.png
  71. BIN
      shields/Seeeed Studio Relay Shield v3/img/Two-relay-shields-one-arduino.png
  72. 163
      shields/Seeeed Studio Relay Shield v3/readme.md

BIN
components/Optocoupler CNY17.pdf

Binary file not shown.

350
shields/Adafruit Motor Shield v2.3/AccelStepper Library/AccelStepper.cpp

@ -0,0 +1,350 @@
// AccelStepper.cpp
//
// Copyright (C) 2009 Mike McCauley
// $Id: AccelStepper.cpp,v 1.2 2010/10/24 07:46:18 mikem Exp mikem $
#include "AccelStepper.h"
void AccelStepper::moveTo(long absolute)
{
_targetPos = absolute;
computeNewSpeed();
}
void AccelStepper::move(long relative)
{
moveTo(_currentPos + relative);
}
// Implements steps according to the current speed
// You must call this at least once per step
// returns true if a step occurred
boolean AccelStepper::runSpeed()
{
unsigned long time = millis();
if (time > _lastStepTime + _stepInterval)
{
if (_speed > 0)
{
// Clockwise
_currentPos += 1;
}
else if (_speed < 0)
{
// Anticlockwise
_currentPos -= 1;
}
step(_currentPos & 0x3); // Bottom 2 bits (same as mod 4, but works with + and - numbers)
_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
void AccelStepper::setCurrentPosition(long position)
{
_currentPos = position;
}
void AccelStepper::computeNewSpeed()
{
setSpeed(desiredSpeed());
}
// Work out and return a new speed.
// Subclasses can override if they want
// Implement acceleration, deceleration and max speed
// Negative speed is anticlockwise
// This is called:
// after each step
// after user changes:
// maxSpeed
// acceleration
// target position (relative or absolute)
float AccelStepper::desiredSpeed()
{
long distanceTo = distanceToGo();
// Max possible speed that can still decelerate in the available distance
float requiredSpeed;
if (distanceTo == 0)
return 0.0; // Were there
else if (distanceTo > 0) // Clockwise
requiredSpeed = sqrt(2.0 * distanceTo * _acceleration);
else // Anticlockwise
requiredSpeed = -sqrt(2.0 * -distanceTo * _acceleration);
if (requiredSpeed > _speed)
{
// Need to accelerate in clockwise direction
if (_speed == 0)
requiredSpeed = sqrt(2.0 * _acceleration);
else
requiredSpeed = _speed + abs(_acceleration / _speed);
if (requiredSpeed > _maxSpeed)
requiredSpeed = _maxSpeed;
}
else if (requiredSpeed < _speed)
{
// Need to accelerate in anticlockwise direction
if (_speed == 0)
requiredSpeed = -sqrt(2.0 * _acceleration);
else
requiredSpeed = _speed - abs(_acceleration / _speed);
if (requiredSpeed < -_maxSpeed)
requiredSpeed = -_maxSpeed;
}
// Serial.println(requiredSpeed);
return requiredSpeed;
}
// 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 we are still running to position
boolean AccelStepper::run()
{
if (_targetPos == _currentPos)
return false;
if (runSpeed())
computeNewSpeed();
return true;
}
AccelStepper::AccelStepper(uint8_t pins, uint8_t pin1, uint8_t pin2, uint8_t pin3, uint8_t pin4)
{
_pins = pins;
_currentPos = 0;
_targetPos = 0;
_speed = 0.0;
_maxSpeed = 1.0;
_acceleration = 1.0;
_stepInterval = 0;
_lastStepTime = 0;
_pin1 = pin1;
_pin2 = pin2;
_pin3 = pin3;
_pin4 = pin4;
enableOutputs();
}
AccelStepper::AccelStepper(void (*forward)(), void (*backward)())
{
_pins = 0;
_currentPos = 0;
_targetPos = 0;
_speed = 0.0;
_maxSpeed = 1.0;
_acceleration = 1.0;
_stepInterval = 0;
_lastStepTime = 0;
_pin1 = 0;
_pin2 = 0;
_pin3 = 0;
_pin4 = 0;
_forward = forward;
_backward = backward;
}
void AccelStepper::setMaxSpeed(float speed)
{
_maxSpeed = speed;
computeNewSpeed();
}
void AccelStepper::setAcceleration(float acceleration)
{
_acceleration = acceleration;
computeNewSpeed();
}
void AccelStepper::setSpeed(float speed)
{
_speed = speed;
_stepInterval = abs(1000.0 / _speed);
}
float AccelStepper::speed()
{
return _speed;
}
// Subclasses can override
void AccelStepper::step(uint8_t step)
{
switch (_pins)
{
case 0:
step0();
break;
case 1:
step1(step);
break;
case 2:
step2(step);
break;
case 4:
step4(step);
break;
}
}
// 0 pin step function (ie for functional usage)
void AccelStepper::step0()
{
if (_speed > 0) {
_forward();
} else {
_backward();
}
}
// 1 pin step function (ie for stepper drivers)
// This is passed the current step number (0 to 3)
// Subclasses can override
void AccelStepper::step1(uint8_t step)
{
digitalWrite(_pin2, _speed > 0); // Direction
// Caution 200ns setup time
digitalWrite(_pin1, HIGH);
// Caution, min Step pulse width for 3967 is 1microsec
// Delay 1microsec
delayMicroseconds(1);
digitalWrite(_pin1, LOW);
}
// 2 pin step function
// This is passed the current step number (0 to 3)
// Subclasses can override
void AccelStepper::step2(uint8_t step)
{
switch (step)
{
case 0: /* 01 */
digitalWrite(_pin1, LOW);
digitalWrite(_pin2, HIGH);
break;
case 1: /* 11 */
digitalWrite(_pin1, HIGH);
digitalWrite(_pin2, HIGH);
break;
case 2: /* 10 */
digitalWrite(_pin1, HIGH);
digitalWrite(_pin2, LOW);
break;
case 3: /* 00 */
digitalWrite(_pin1, LOW);
digitalWrite(_pin2, LOW);
break;
}
}
// 4 pin step function
// This is passed the current step number (0 to 3)
// Subclasses can override
void AccelStepper::step4(uint8_t step)
{
switch (step)
{
case 0: // 1010
digitalWrite(_pin1, HIGH);
digitalWrite(_pin2, LOW);
digitalWrite(_pin3, HIGH);
digitalWrite(_pin4, LOW);
break;
case 1: // 0110
digitalWrite(_pin1, LOW);
digitalWrite(_pin2, HIGH);
digitalWrite(_pin3, HIGH);
digitalWrite(_pin4, LOW);
break;
case 2: //0101
digitalWrite(_pin1, LOW);
digitalWrite(_pin2, HIGH);
digitalWrite(_pin3, LOW);
digitalWrite(_pin4, HIGH);
break;
case 3: //1001
digitalWrite(_pin1, HIGH);
digitalWrite(_pin2, LOW);
digitalWrite(_pin3, LOW);
digitalWrite(_pin4, HIGH);
break;
}
}
// Prevents power consumption on the outputs
void AccelStepper::disableOutputs()
{
if (! _pins) return;
digitalWrite(_pin1, LOW);
digitalWrite(_pin2, LOW);
if (_pins == 4)
{
digitalWrite(_pin3, LOW);
digitalWrite(_pin4, LOW);
}
}
void AccelStepper::enableOutputs()
{
if (! _pins) return;
pinMode(_pin1, OUTPUT);
pinMode(_pin2, OUTPUT);
if (_pins == 4)
{
pinMode(_pin3, OUTPUT);
pinMode(_pin4, OUTPUT);
}
}
// Blocks until the target position is reached
void AccelStepper::runToPosition()
{
while (run())
;
}
boolean AccelStepper::runSpeedToPosition()
{
return _targetPos!=_currentPos ? AccelStepper::runSpeed() : false;
}
// Blocks until the new target position is reached
void AccelStepper::runToNewPosition(long position)
{
moveTo(position);
runToPosition();
}

339
shields/Adafruit Motor Shield v2.3/AccelStepper Library/AccelStepper.h

@ -0,0 +1,339 @@
// AccelStepper.h
//
/// \mainpage AccelStepper library for Arduino
///
/// This is the Arduino AccelStepper 1.2 library.
/// It provides an object-oriented interface for 2 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 and 4 wire steppers
/// \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.open.com.au/mikem/arduino/AccelStepper
///
/// Example Arduino programs are included to show the main modes of use.
///
/// The version of the package that this documentation refers to can be downloaded
/// from http://www.open.com.au/mikem/arduino/AccelStepper/AccelStepper-1.3.zip
/// You can find the latest version at http://www.open.com.au/mikem/arduino/AccelStepper
///
/// Tested on Arduino Diecimila and Mega with arduino-0018 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.
///
/// \par Installation
/// Install in the usual way: unzip the distribution zip file to the libraries
/// sub-folder of your sketchbook.
///
/// 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@open.com.au 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
///
///
/// \author Mike McCauley (mikem@open.com.au)
// Copyright (C) 2009 Mike McCauley
// $Id: AccelStepper.h,v 1.2 2010/10/24 07:46:18 mikem Exp mikem $
#ifndef AccelStepper_h
#define AccelStepper_h
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#include "stdlib.h"
#include "wiring.h"
#endif
// These defs cause trouble on some versions of Arduino
#undef round
/////////////////////////////////////////////////////////////////////
/// \class AccelStepper AccelStepper.h <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 milliseconds. 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
/// milliseconds. The run() function steps the motor 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 curent 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).
///
/// The fastest motor speed that can be reliably supported is 1000 steps per
/// second (1 step every millisecond). However any speed less than that down
/// to very slow speeds (much less than one per second) are supported,
/// provided the run() function is called frequently enough to step the
/// motor whenever required.
class AccelStepper
{
public:
/// 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] pins Number of pins to interface to. 1, 2 or 4 are
/// supported. 1 means a stepper driver (with Step and Direction pins)
/// 2 means a 2 wire stepper. 4 means a 4 wire stepper.
/// Defaults to 4 pins.
/// \param[in] pin1 Arduino digital pin number for motor pin 1. Defaults
/// to pin 2. For a driver (pins==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 driver (pins==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.
AccelStepper(uint8_t pins = 4, uint8_t pin1 = 2, uint8_t pin2 = 3, uint8_t pin3 = 4, uint8_t pin4 = 5);
/// 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.
/// 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
/// from the current position to the target position set by the most
/// recent call to this function.
/// \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 achive the ratget position. You must call this as
/// fequently as possible, but at least once per minimum step interval,
/// preferably in your main loop.
/// \return true if the motor is at the target position.
boolean run();
/// Poll the motor and step it if a step is due, implmenting a constant
/// speed as set by the most recent call to setSpeed().
/// \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.
/// \param[in] speed The desired maximum speed in steps per second. Must
/// be > 0. Speeds of more than 1000 steps per second are unreliable.
void setMaxSpeed(float speed);
/// Sets the acceleration and deceleration parameter.
/// \param[in] acceleration The desired acceleration in steps per second
/// per second. Must be > 0.
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 mottor
/// happens to be right now is considered to be the new position. Useful
/// for setting a zero position on a stepper after an initial hardware
/// positioning move.
/// \param[in] position The position in steps of wherever the motor
/// happens to be right now.
void setCurrentPosition(long position);
/// Moves the motor 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.
boolean runSpeedToPosition();
/// Moves the motor 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);
/// 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.
void disableOutputs();
/// Enable motor pin outputs by setting the motor pins to OUTPUT
/// mode. Called automatically by the constructor.
void enableOutputs();
protected:
/// Forces the library to compute a new instantaneous speed and set that as
/// the current speed. Calls
/// desiredSpeed(), which can be overridden by subclasses. 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();
/// 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() or step4() depending on the
/// number of pins defined for the stepper.
/// \param[in] step The current step phase number (0 to 3)
virtual void step(uint8_t 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
virtual void step0(void);
/// Called to execute a step on a stepper drover (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 3)
virtual void step1(uint8_t 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 3)
virtual void step2(uint8_t 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 3)
virtual void step4(uint8_t step);
/// Compute and return the desired speed. The default algorithm uses
/// maxSpeed, acceleration and the current speed to set a new speed to
/// move the motor from teh current position to the target
/// position. Subclasses may override this to provide an alternate
/// algorithm (but do not block). Called by computeNewSpeed whenever a new speed neds to be
/// computed.
virtual float desiredSpeed();
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 _pins; // 2 or 4
/// Arduino pin number for the 2 or 4 pins required to interface to the
/// stepper motor.
uint8_t _pin1, _pin2, _pin3, _pin4;
/// The current absolution position in steps.
long _currentPos; // Steps
/// The target position in steps. The AccelStepper library will move the
/// motor from teh _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;
/// The current interval between steps in milliseconds.
unsigned long _stepInterval;
/// The last step time in milliseconds
unsigned long _lastStepTime;
// The pointer to a forward-step procedure
void (*_forward)();
// The pointer to a backward-step procedure
void (*_backward)();
};
#endif

17
shields/Adafruit Motor Shield v2.3/AccelStepper Library/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.

27
shields/Adafruit Motor Shield v2.3/AccelStepper Library/MANIFEST

@ -0,0 +1,27 @@
AccelStepper/Makefile
AccelStepper/AccelStepper.h
AccelStepper/AccelStepper.cpp
AccelStepper/MANIFEST
AccelStepper/LICENSE
AccelStepper/project.cfg
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/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

26
shields/Adafruit Motor Shield v2.3/AccelStepper Library/Makefile

@ -0,0 +1,26 @@
# Makefile
#
# Makefile for the Arduino AccelStepper project
#
# Author: Mike McCauley (mikem@open.com.au)
# Copyright (C) 2010 Mike McCauley
# $Id: Makefile,v 1.1 2010/04/25 02:21:18 mikem Exp mikem $
PROJNAME = AccelStepper
# Dont forget to also change the version at the top of AccelStepper.h:
DISTFILE = $(PROJNAME)-1.3.zip
all: doxygen dist upload
doxygen:
doxygen project.cfg
ci:
ci -l `cat MANIFEST`
dist:
(cd ..; zip $(PROJNAME)/$(DISTFILE) `cat $(PROJNAME)/MANIFEST`)
upload:
scp $(DISTFILE) doc/*.html doc/*.gif doc/*.png doc/*.css doc/*.pdf server2:/var/www/html/mikem/arduino/$(PROJNAME)

1
shields/Adafruit Motor Shield v2.3/AccelStepper Library/README.txt

@ -0,0 +1 @@
TO INSTALL: Download zip by clicking "DOWNLOADS" in top right corner. Then uncompress folder and rename to AccelStepper. Make sure that folder contains this README. Then copy to sketchfolder/libraries (see also http://www.ladyada.net/library/arduino/libraries.html)

336
shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/AccelStepper_8h-source.html

@ -0,0 +1,336 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>AccelStepper: AccelStepper.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<h1>AccelStepper.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// AccelStepper.h</span>
<a name="l00002"></a>00002 <span class="comment">//</span><span class="comment"></span>
<a name="l00003"></a>00003 <span class="comment">/// \mainpage AccelStepper library for Arduino</span>
<a name="l00004"></a>00004 <span class="comment">///</span>
<a name="l00005"></a>00005 <span class="comment">/// This is the Arduino AccelStepper 1.2 library.</span>
<a name="l00006"></a>00006 <span class="comment">/// It provides an object-oriented interface for 2 or 4 pin stepper motors.</span>
<a name="l00007"></a>00007 <span class="comment">///</span>
<a name="l00008"></a>00008 <span class="comment">/// The standard Arduino IDE includes the Stepper library</span>
<a name="l00009"></a>00009 <span class="comment">/// (http://arduino.cc/en/Reference/Stepper) for stepper motors. It is</span>
<a name="l00010"></a>00010 <span class="comment">/// perfectly adequate for simple, single motor applications.</span>
<a name="l00011"></a>00011 <span class="comment">///</span>
<a name="l00012"></a>00012 <span class="comment">/// AccelStepper significantly improves on the standard Arduino Stepper library in several ways:</span>
<a name="l00013"></a>00013 <span class="comment">/// \li Supports acceleration and deceleration</span>
<a name="l00014"></a>00014 <span class="comment">/// \li Supports multiple simultaneous steppers, with independent concurrent stepping on each stepper</span>
<a name="l00015"></a>00015 <span class="comment">/// \li API functions never delay() or block</span>
<a name="l00016"></a>00016 <span class="comment">/// \li Supports 2 and 4 wire steppers</span>
<a name="l00017"></a>00017 <span class="comment">/// \li Supports stepper drivers such as the Sparkfun EasyDriver (based on 3967 driver chip)</span>
<a name="l00018"></a>00018 <span class="comment">/// \li Very slow speeds are supported</span>
<a name="l00019"></a>00019 <span class="comment">/// \li Extensive API</span>
<a name="l00020"></a>00020 <span class="comment">/// \li Subclass support</span>
<a name="l00021"></a>00021 <span class="comment">///</span>
<a name="l00022"></a>00022 <span class="comment">/// The latest version of this documentation can be downloaded from </span>
<a name="l00023"></a>00023 <span class="comment">/// http://www.open.com.au/mikem/arduino/AccelStepper</span>
<a name="l00024"></a>00024 <span class="comment">///</span>
<a name="l00025"></a>00025 <span class="comment">/// Example Arduino programs are included to show the main modes of use.</span>
<a name="l00026"></a>00026 <span class="comment">///</span>
<a name="l00027"></a>00027 <span class="comment">/// The version of the package that this documentation refers to can be downloaded </span>
<a name="l00028"></a>00028 <span class="comment">/// from http://www.open.com.au/mikem/arduino/AccelStepper/AccelStepper-1.3.zip</span>
<a name="l00029"></a>00029 <span class="comment">/// You can find the latest version at http://www.open.com.au/mikem/arduino/AccelStepper</span>
<a name="l00030"></a>00030 <span class="comment">///</span>
<a name="l00031"></a>00031 <span class="comment">/// Tested on Arduino Diecimila and Mega with arduino-0018 on OpenSuSE 11.1 and avr-libc-1.6.1-1.15,</span>
<a name="l00032"></a>00032 <span class="comment">/// cross-avr-binutils-2.19-9.1, cross-avr-gcc-4.1.3_20080612-26.5.</span>
<a name="l00033"></a>00033 <span class="comment">///</span>
<a name="l00034"></a>00034 <span class="comment">/// \par Installation</span>
<a name="l00035"></a>00035 <span class="comment">/// Install in the usual way: unzip the distribution zip file to the libraries</span>
<a name="l00036"></a>00036 <span class="comment">/// sub-folder of your sketchbook. </span>
<a name="l00037"></a>00037 <span class="comment">///</span>
<a name="l00038"></a>00038 <span class="comment">/// This software is Copyright (C) 2010 Mike McCauley. Use is subject to license</span>
<a name="l00039"></a>00039 <span class="comment">/// conditions. The main licensing options available are GPL V2 or Commercial:</span>
<a name="l00040"></a>00040 <span class="comment">/// </span>
<a name="l00041"></a>00041 <span class="comment">/// \par Open Source Licensing GPL V2</span>
<a name="l00042"></a>00042 <span class="comment">/// This is the appropriate option if you want to share the source code of your</span>
<a name="l00043"></a>00043 <span class="comment">/// application with everyone you distribute it to, and you also want to give them</span>
<a name="l00044"></a>00044 <span class="comment">/// the right to share who uses it. If you wish to use this software under Open</span>
<a name="l00045"></a>00045 <span class="comment">/// Source Licensing, you must contribute all your source code to the open source</span>
<a name="l00046"></a>00046 <span class="comment">/// community in accordance with the GPL Version 2 when your application is</span>
<a name="l00047"></a>00047 <span class="comment">/// distributed. See http://www.gnu.org/copyleft/gpl.html</span>
<a name="l00048"></a>00048 <span class="comment">/// </span>
<a name="l00049"></a>00049 <span class="comment">/// \par Commercial Licensing</span>
<a name="l00050"></a>00050 <span class="comment">/// This is the appropriate option if you are creating proprietary applications</span>
<a name="l00051"></a>00051 <span class="comment">/// and you are not prepared to distribute and share the source code of your</span>
<a name="l00052"></a>00052 <span class="comment">/// application. Contact info@open.com.au for details.</span>
<a name="l00053"></a>00053 <span class="comment">///</span>
<a name="l00054"></a>00054 <span class="comment">/// \par Revision History</span>
<a name="l00055"></a>00055 <span class="comment">/// \version 1.0 Initial release</span>
<a name="l00056"></a>00056 <span class="comment">///</span>
<a name="l00057"></a>00057 <span class="comment">/// \version 1.1 Added speed() function to get the current speed.</span>
<a name="l00058"></a>00058 <span class="comment">/// \version 1.2 Added runSpeedToPosition() submitted by Gunnar Arndt.</span>
<a name="l00059"></a>00059 <span class="comment">/// \version 1.3 Added support for stepper drivers (ie with Step and Direction inputs) with _pins == 1</span>
<a name="l00060"></a>00060 <span class="comment">/// </span>
<a name="l00061"></a>00061 <span class="comment">///</span>
<a name="l00062"></a>00062 <span class="comment">/// \author Mike McCauley (mikem@open.com.au)</span>
<a name="l00063"></a>00063 <span class="comment"></span><span class="comment">// Copyright (C) 2009 Mike McCauley</span>
<a name="l00064"></a>00064 <span class="comment">// $Id: AccelStepper.h,v 1.2 2010/10/24 07:46:18 mikem Exp mikem $</span>
<a name="l00065"></a>00065
<a name="l00066"></a>00066 <span class="preprocessor">#ifndef AccelStepper_h</span>
<a name="l00067"></a>00067 <span class="preprocessor"></span><span class="preprocessor">#define AccelStepper_h</span>
<a name="l00068"></a>00068 <span class="preprocessor"></span>
<a name="l00069"></a>00069 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<a name="l00070"></a>00070 <span class="preprocessor">#include &lt;wiring.h&gt;</span>
<a name="l00071"></a>00071
<a name="l00072"></a>00072 <span class="comment">// These defs cause trouble on some versions of Arduino</span>
<a name="l00073"></a>00073 <span class="preprocessor">#undef round</span>
<a name="l00074"></a>00074 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00075"></a>00075 <span class="comment">/////////////////////////////////////////////////////////////////////</span>
<a name="l00076"></a>00076 <span class="comment">/// \class AccelStepper AccelStepper.h &lt;AccelStepper.h&gt;</span>
<a name="l00077"></a>00077 <span class="comment">/// \brief Support for stepper motors with acceleration etc.</span>
<a name="l00078"></a>00078 <span class="comment">///</span>
<a name="l00079"></a>00079 <span class="comment">/// This defines a single 2 or 4 pin stepper motor, or stepper moter with fdriver chip, with optional</span>
<a name="l00080"></a>00080 <span class="comment">/// acceleration, deceleration, absolute positioning commands etc. Multiple</span>
<a name="l00081"></a>00081 <span class="comment">/// simultaneous steppers are supported, all moving </span>
<a name="l00082"></a>00082 <span class="comment">/// at different speeds and accelerations. </span>
<a name="l00083"></a>00083 <span class="comment">///</span>
<a name="l00084"></a>00084 <span class="comment">/// \par Operation</span>
<a name="l00085"></a>00085 <span class="comment">/// This module operates by computing a step time in milliseconds. The step</span>
<a name="l00086"></a>00086 <span class="comment">/// time is recomputed after each step and after speed and acceleration</span>
<a name="l00087"></a>00087 <span class="comment">/// parameters are changed by the caller. The time of each step is recorded in</span>
<a name="l00088"></a>00088 <span class="comment">/// milliseconds. The run() function steps the motor if a new step is due.</span>
<a name="l00089"></a>00089 <span class="comment">/// The run() function must be called frequently until the motor is in the</span>
<a name="l00090"></a>00090 <span class="comment">/// desired position, after which time run() will do nothing.</span>
<a name="l00091"></a>00091 <span class="comment">///</span>
<a name="l00092"></a>00092 <span class="comment">/// \par Positioning</span>
<a name="l00093"></a>00093 <span class="comment">/// Positions are specified by a signed long integer. At</span>
<a name="l00094"></a>00094 <span class="comment">/// construction time, the current position of the motor is consider to be 0. Positive</span>
<a name="l00095"></a>00095 <span class="comment">/// positions are clockwise from the initial position; negative positions are</span>
<a name="l00096"></a>00096 <span class="comment">/// anticlockwise. The curent position can be altered for instance after</span>
<a name="l00097"></a>00097 <span class="comment">/// initialization positioning.</span>
<a name="l00098"></a>00098 <span class="comment">///</span>
<a name="l00099"></a>00099 <span class="comment">/// \par Caveats</span>
<a name="l00100"></a>00100 <span class="comment">/// This is an open loop controller: If the motor stalls or is oversped,</span>
<a name="l00101"></a>00101 <span class="comment">/// AccelStepper will not have a correct </span>
<a name="l00102"></a>00102 <span class="comment">/// idea of where the motor really is (since there is no feedback of the motor's</span>
<a name="l00103"></a>00103 <span class="comment">/// real position. We only know where we _think_ it is, relative to the</span>
<a name="l00104"></a>00104 <span class="comment">/// initial starting point).</span>
<a name="l00105"></a>00105 <span class="comment">///</span>
<a name="l00106"></a>00106 <span class="comment">/// The fastest motor speed that can be reliably supported is 1000 steps per</span>
<a name="l00107"></a>00107 <span class="comment">/// second (1 step every millisecond). However any speed less than that down</span>
<a name="l00108"></a>00108 <span class="comment">/// to very slow speeds (much less than one per second) are supported,</span>
<a name="l00109"></a>00109 <span class="comment">/// provided the run() function is called frequently enough to step the</span>
<a name="l00110"></a>00110 <span class="comment">/// motor whenever required.</span>
<a name="l00111"></a><a class="code" href="classAccelStepper.html">00111</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="classAccelStepper.html" title="Support for stepper motors with acceleration etc.">AccelStepper</a>
<a name="l00112"></a>00112 {
<a name="l00113"></a>00113 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00114"></a>00114 <span class="comment"> /// Constructor. You can have multiple simultaneous steppers, all moving</span>
<a name="l00115"></a>00115 <span class="comment"> /// at different speeds and accelerations, provided you call their run()</span>
<a name="l00116"></a>00116 <span class="comment"> /// functions at frequent enough intervals. Current Position is set to 0, target</span>
<a name="l00117"></a>00117 <span class="comment"> /// position is set to 0. MaxSpeed and Acceleration default to 1.0.</span>
<a name="l00118"></a>00118 <span class="comment"> /// The motor pins will be initialised to OUTPUT mode during the</span>
<a name="l00119"></a>00119 <span class="comment"> /// constructor by a call to enableOutputs().</span>
<a name="l00120"></a>00120 <span class="comment"> /// \param[in] pins Number of pins to interface to. 1, 2 or 4 are</span>
<a name="l00121"></a>00121 <span class="comment"> /// supported. 1 means a stepper driver (with Step and Direction pins)</span>
<a name="l00122"></a>00122 <span class="comment"> /// 2 means a 2 wire stepper. 4 means a 4 wire stepper.</span>
<a name="l00123"></a>00123 <span class="comment"> /// Defaults to 4 pins.</span>
<a name="l00124"></a>00124 <span class="comment"> /// \param[in] pin1 Arduino digital pin number for motor pin 1. Defaults</span>
<a name="l00125"></a>00125 <span class="comment"> /// to pin 2. For a driver (pins==1), this is the Step input to the driver. Low to high transition means to step)</span>
<a name="l00126"></a>00126 <span class="comment"> /// \param[in] pin2 Arduino digital pin number for motor pin 2. Defaults</span>
<a name="l00127"></a>00127 <span class="comment"> /// to pin 3. For a driver (pins==1), this is the Direction input the driver. High means forward.</span>
<a name="l00128"></a>00128 <span class="comment"> /// \param[in] pin3 Arduino digital pin number for motor pin 3. Defaults</span>
<a name="l00129"></a>00129 <span class="comment"> /// to pin 4.</span>
<a name="l00130"></a>00130 <span class="comment"> /// \param[in] pin4 Arduino digital pin number for motor pin 4. Defaults</span>
<a name="l00131"></a>00131 <span class="comment"> /// to pin 5.</span>
<a name="l00132"></a>00132 <span class="comment"></span> <a class="code" href="classAccelStepper.html#a1290897df35915069e5eca9d034038c">AccelStepper</a>(uint8_t pins = 4, uint8_t pin1 = 2, uint8_t pin2 = 3, uint8_t pin3 = 4, uint8_t pin4 = 5);
<a name="l00133"></a>00133 <span class="comment"></span>
<a name="l00134"></a>00134 <span class="comment"> /// Set the target position. The run() function will try to move the motor</span>
<a name="l00135"></a>00135 <span class="comment"> /// from the current position to the target position set by the most</span>
<a name="l00136"></a>00136 <span class="comment"> /// recent call to this function.</span>
<a name="l00137"></a>00137 <span class="comment"> /// \param[in] absolute The desired absolute position. Negative is</span>
<a name="l00138"></a>00138 <span class="comment"> /// anticlockwise from the 0 position.</span>
<a name="l00139"></a>00139 <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="classAccelStepper.html#ce236ede35f87c63d18da25810ec9736">moveTo</a>(<span class="keywordtype">long</span> absolute);
<a name="l00140"></a>00140 <span class="comment"></span>
<a name="l00141"></a>00141 <span class="comment"> /// Set the target position relative to the current position</span>
<a name="l00142"></a>00142 <span class="comment"> /// \param[in] relative The desired position relative to the current position. Negative is</span>
<a name="l00143"></a>00143 <span class="comment"> /// anticlockwise from the current position.</span>
<a name="l00144"></a>00144 <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="classAccelStepper.html#68942c66e78fb7f7b5f0cdade6eb7f06">move</a>(<span class="keywordtype">long</span> relative);
<a name="l00145"></a>00145 <span class="comment"></span>
<a name="l00146"></a>00146 <span class="comment"> /// Poll the motor and step it if a step is due, implementing</span>
<a name="l00147"></a>00147 <span class="comment"> /// accelerations and decelerations to achive the ratget position. You must call this as</span>
<a name="l00148"></a>00148 <span class="comment"> /// fequently as possible, but at least once per minimum step interval,</span>
<a name="l00149"></a>00149 <span class="comment"> /// preferably in your main loop.</span>
<a name="l00150"></a>00150 <span class="comment"> /// \return true if the motor is at the target position.</span>
<a name="l00151"></a>00151 <span class="comment"></span> <span class="keywordtype">boolean</span> <a class="code" href="classAccelStepper.html#608b2395b64ac15451d16d0371fe13ce">run</a>();
<a name="l00152"></a>00152 <span class="comment"></span>
<a name="l00153"></a>00153 <span class="comment"> /// Poll the motor and step it if a step is due, implmenting a constant</span>
<a name="l00154"></a>00154 <span class="comment"> /// speed as set by the most recent call to setSpeed().</span>
<a name="l00155"></a>00155 <span class="comment"> /// \return true if the motor was stepped.</span>
<a name="l00156"></a>00156 <span class="comment"></span> <span class="keywordtype">boolean</span> <a class="code" href="classAccelStepper.html#a4a6bdf99f698284faaeb5542b0b7514">runSpeed</a>();
<a name="l00157"></a>00157 <span class="comment"></span>
<a name="l00158"></a>00158 <span class="comment"> /// Sets the maximum permitted speed. the run() function will accelerate</span>
<a name="l00159"></a>00159 <span class="comment"> /// up to the speed set by this function.</span>
<a name="l00160"></a>00160 <span class="comment"> /// \param[in] speed The desired maximum speed in steps per second. Must</span>
<a name="l00161"></a>00161 <span class="comment"> /// be &gt; 0. Speeds of more than 1000 steps per second are unreliable. </span>
<a name="l00162"></a>00162 <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="classAccelStepper.html#bee8d466229b87accba33d6ec929c18f">setMaxSpeed</a>(<span class="keywordtype">float</span> <a class="code" href="classAccelStepper.html#4f0989d0ae264e7eadfe1fa720769fb6">speed</a>);
<a name="l00163"></a>00163 <span class="comment"></span>
<a name="l00164"></a>00164 <span class="comment"> /// Sets the acceleration and deceleration parameter.</span>
<a name="l00165"></a>00165 <span class="comment"> /// \param[in] acceleration The desired acceleration in steps per second</span>
<a name="l00166"></a>00166 <span class="comment"> /// per second. Must be &gt; 0.</span>
<a name="l00167"></a>00167 <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="classAccelStepper.html#dfb19e3cd2a028a1fe78131787604fd1">setAcceleration</a>(<span class="keywordtype">float</span> acceleration);
<a name="l00168"></a>00168 <span class="comment"></span>
<a name="l00169"></a>00169 <span class="comment"> /// Sets the desired constant speed for use with runSpeed().</span>
<a name="l00170"></a>00170 <span class="comment"> /// \param[in] speed The desired constant speed in steps per</span>
<a name="l00171"></a>00171 <span class="comment"> /// second. Positive is clockwise. Speeds of more than 1000 steps per</span>
<a name="l00172"></a>00172 <span class="comment"> /// second are unreliable. Very slow speeds may be set (eg 0.00027777 for</span>
<a name="l00173"></a>00173 <span class="comment"> /// once per hour, approximately. Speed accuracy depends on the Arduino</span>
<a name="l00174"></a>00174 <span class="comment"> /// crystal. Jitter depends on how frequently you call the runSpeed() function.</span>
<a name="l00175"></a>00175 <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="classAccelStepper.html#e79c49ad69d5ccc9da0ee691fa4ca235">setSpeed</a>(<span class="keywordtype">float</span> speed);
<a name="l00176"></a>00176 <span class="comment"></span>
<a name="l00177"></a>00177 <span class="comment"> /// The most recently set speed</span>
<a name="l00178"></a>00178 <span class="comment"> /// \return the most recent speed in steps per second</span>
<a name="l00179"></a>00179 <span class="comment"></span> <span class="keywordtype">float</span> <a class="code" href="classAccelStepper.html#4f0989d0ae264e7eadfe1fa720769fb6">speed</a>();
<a name="l00180"></a>00180 <span class="comment"></span>
<a name="l00181"></a>00181 <span class="comment"> /// The distance from the current position to the target position.</span>
<a name="l00182"></a>00182 <span class="comment"> /// \return the distance from the current position to the target position</span>
<a name="l00183"></a>00183 <span class="comment"> /// in steps. Positive is clockwise from the current position.</span>
<a name="l00184"></a>00184 <span class="comment"></span> <span class="keywordtype">long</span> <a class="code" href="classAccelStepper.html#748665c3962e66fbc0e9373eb14c69c1">distanceToGo</a>();
<a name="l00185"></a>00185 <span class="comment"></span>
<a name="l00186"></a>00186 <span class="comment"> /// The most recently set target position.</span>
<a name="l00187"></a>00187 <span class="comment"> /// \return the target position</span>
<a name="l00188"></a>00188 <span class="comment"> /// in steps. Positive is clockwise from the 0 position.</span>
<a name="l00189"></a>00189 <span class="comment"></span> <span class="keywordtype">long</span> <a class="code" href="classAccelStepper.html#96685e0945b7cf75d5959da679cd911e">targetPosition</a>();
<a name="l00190"></a>00190
<a name="l00191"></a>00191 <span class="comment"></span>
<a name="l00192"></a>00192 <span class="comment"> /// The currently motor position.</span>
<a name="l00193"></a>00193 <span class="comment"> /// \return the current motor position</span>
<a name="l00194"></a>00194 <span class="comment"> /// in steps. Positive is clockwise from the 0 position.</span>
<a name="l00195"></a>00195 <span class="comment"></span> <span class="keywordtype">long</span> <a class="code" href="classAccelStepper.html#5dce13ab2a1b02b8f443318886bf6fc5">currentPosition</a>();
<a name="l00196"></a>00196 <span class="comment"></span>
<a name="l00197"></a>00197 <span class="comment"> /// Resets the current position of the motor, so that wherever the mottor</span>
<a name="l00198"></a>00198 <span class="comment"> /// happens to be right now is considered to be the new position. Useful</span>
<a name="l00199"></a>00199 <span class="comment"> /// for setting a zero position on a stepper after an initial hardware</span>
<a name="l00200"></a>00200 <span class="comment"> /// positioning move.</span>
<a name="l00201"></a>00201 <span class="comment"> /// \param[in] position The position in steps of wherever the motor</span>
<a name="l00202"></a>00202 <span class="comment"> /// happens to be right now.</span>
<a name="l00203"></a>00203 <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="classAccelStepper.html#9d917f014317fb9d3b5dc14e66f6c689">setCurrentPosition</a>(<span class="keywordtype">long</span> position);
<a name="l00204"></a>00204 <span class="comment"></span>
<a name="l00205"></a>00205 <span class="comment"> /// Moves the motor to the target position and blocks until it is at</span>
<a name="l00206"></a>00206 <span class="comment"> /// position. Dont use this in event loops, since it blocks.</span>
<a name="l00207"></a>00207 <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="classAccelStepper.html#344f58fef8cc34ac5aa75ba4b665d21c">runToPosition</a>();
<a name="l00208"></a>00208 <span class="comment"></span>
<a name="l00209"></a>00209 <span class="comment"> /// Runs at the currently selected speed until the target position is reached</span>
<a name="l00210"></a>00210 <span class="comment"> /// Does not implement accelerations.</span>
<a name="l00211"></a>00211 <span class="comment"></span> <span class="keywordtype">boolean</span> <a class="code" href="classAccelStepper.html#9270d20336e76ac1fd5bcd5b9c34f301">runSpeedToPosition</a>();
<a name="l00212"></a>00212 <span class="comment"></span>
<a name="l00213"></a>00213 <span class="comment"> /// Moves the motor to the new target position and blocks until it is at</span>
<a name="l00214"></a>00214 <span class="comment"> /// position. Dont use this in event loops, since it blocks.</span>
<a name="l00215"></a>00215 <span class="comment"> /// \param[in] position The new target position.</span>
<a name="l00216"></a>00216 <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="classAccelStepper.html#176c5d2e4c2f21e9e92b12e39a6f0e67">runToNewPosition</a>(<span class="keywordtype">long</span> position);
<a name="l00217"></a>00217 <span class="comment"></span>
<a name="l00218"></a>00218 <span class="comment"> /// Disable motor pin outputs by setting them all LOW</span>
<a name="l00219"></a>00219 <span class="comment"> /// Depending on the design of your electronics this may turn off</span>
<a name="l00220"></a>00220 <span class="comment"> /// the power to the motor coils, saving power.</span>
<a name="l00221"></a>00221 <span class="comment"> /// This is useful to support Arduino low power modes: disable the outputs</span>
<a name="l00222"></a>00222 <span class="comment"> /// during sleep and then reenable with enableOutputs() before stepping</span>
<a name="l00223"></a>00223 <span class="comment"> /// again.</span>
<a name="l00224"></a>00224 <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="classAccelStepper.html#3591e29a236e2935afd7f64ff6c22006">disableOutputs</a>();
<a name="l00225"></a>00225 <span class="comment"></span>
<a name="l00226"></a>00226 <span class="comment"> /// Enable motor pin outputs by setting the motor pins to OUTPUT</span>
<a name="l00227"></a>00227 <span class="comment"> /// mode. Called automatically by the constructor.</span>
<a name="l00228"></a>00228 <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="classAccelStepper.html#a279a50d30d0413f570c692cff071643">enableOutputs</a>();
<a name="l00229"></a>00229
<a name="l00230"></a>00230 <span class="keyword">protected</span>:
<a name="l00231"></a>00231 <span class="comment"></span>
<a name="l00232"></a>00232 <span class="comment"> /// Forces the library to compute a new instantaneous speed and set that as</span>
<a name="l00233"></a>00233 <span class="comment"> /// the current speed. Calls</span>
<a name="l00234"></a>00234 <span class="comment"> /// desiredSpeed(), which can be overridden by subclasses. It is called by</span>
<a name="l00235"></a>00235 <span class="comment"> /// the library:</span>
<a name="l00236"></a>00236 <span class="comment"> /// \li after each step</span>
<a name="l00237"></a>00237 <span class="comment"> /// \li after change to maxSpeed through setMaxSpeed()</span>
<a name="l00238"></a>00238 <span class="comment"> /// \li after change to acceleration through setAcceleration()</span>
<a name="l00239"></a>00239 <span class="comment"> /// \li after change to target position (relative or absolute) through</span>
<a name="l00240"></a>00240 <span class="comment"> /// move() or moveTo()</span>
<a name="l00241"></a>00241 <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="classAccelStepper.html#ffbee789b5c19165846cf0409860ae79">computeNewSpeed</a>();
<a name="l00242"></a>00242 <span class="comment"></span>
<a name="l00243"></a>00243 <span class="comment"> /// Called to execute a step. Only called when a new step is</span>
<a name="l00244"></a>00244 <span class="comment"> /// required. Subclasses may override to implement new stepping</span>
<a name="l00245"></a>00245 <span class="comment"> /// interfaces. The default calls step1(), step2() or step4() depending on the</span>
<a name="l00246"></a>00246 <span class="comment"> /// number of pins defined for the stepper.</span>
<a name="l00247"></a>00247 <span class="comment"> /// \param[in] step The current step phase number (0 to 3)</span>
<a name="l00248"></a>00248 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classAccelStepper.html#3c9a220819d2451f79ff8a0c0a395b9f">step</a>(uint8_t <a class="code" href="classAccelStepper.html#3c9a220819d2451f79ff8a0c0a395b9f">step</a>);
<a name="l00249"></a>00249
<a name="l00250"></a>00250 <span class="comment"></span>
<a name="l00251"></a>00251 <span class="comment"> /// Called to execute a step on a stepper drover (ie where pins == 1). Only called when a new step is</span>
<a name="l00252"></a>00252 <span class="comment"> /// required. Subclasses may override to implement new stepping</span>
<a name="l00253"></a>00253 <span class="comment"> /// interfaces. The default sets or clears the outputs of Step pin1 to step, </span>
<a name="l00254"></a>00254 <span class="comment"> /// and sets the output of _pin2 to the desired direction. The Step pin (_pin1) is pulsed for 1 microsecond</span>
<a name="l00255"></a>00255 <span class="comment"> /// which is the minimum STEP pulse width for the 3967 driver.</span>
<a name="l00256"></a>00256 <span class="comment"> /// \param[in] step The current step phase number (0 to 3)</span>
<a name="l00257"></a>00257 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classAccelStepper.html#cc64254ea242b53588e948335fd9305f">step1</a>(uint8_t step);
<a name="l00258"></a>00258 <span class="comment"></span>
<a name="l00259"></a>00259 <span class="comment"> /// Called to execute a step on a 2 pin motor. Only called when a new step is</span>
<a name="l00260"></a>00260 <span class="comment"> /// required. Subclasses may override to implement new stepping</span>
<a name="l00261"></a>00261 <span class="comment"> /// interfaces. The default sets or clears the outputs of pin1 and pin2</span>
<a name="l00262"></a>00262 <span class="comment"> /// \param[in] step The current step phase number (0 to 3)</span>
<a name="l00263"></a>00263 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classAccelStepper.html#88f11bf6361fe002585f731d34fe2e8b">step2</a>(uint8_t step);
<a name="l00264"></a>00264 <span class="comment"></span>
<a name="l00265"></a>00265 <span class="comment"> /// Called to execute a step on a 4 pin motor. Only called when a new step is</span>
<a name="l00266"></a>00266 <span class="comment"> /// required. Subclasses may override to implement new stepping</span>
<a name="l00267"></a>00267 <span class="comment"> /// interfaces. The default sets or clears the outputs of pin1, pin2,</span>
<a name="l00268"></a>00268 <span class="comment"> /// pin3, pin4.</span>
<a name="l00269"></a>00269 <span class="comment"> /// \param[in] step The current step phase number (0 to 3)</span>
<a name="l00270"></a>00270 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classAccelStepper.html#49e448d179bbe4e0f8003a3f9993789d">step4</a>(uint8_t step);
<a name="l00271"></a>00271 <span class="comment"></span>
<a name="l00272"></a>00272 <span class="comment"> /// Compute and return the desired speed. The default algorithm uses</span>
<a name="l00273"></a>00273 <span class="comment"> /// maxSpeed, acceleration and the current speed to set a new speed to</span>
<a name="l00274"></a>00274 <span class="comment"> /// move the motor from teh current position to the target</span>
<a name="l00275"></a>00275 <span class="comment"> /// position. Subclasses may override this to provide an alternate</span>
<a name="l00276"></a>00276 <span class="comment"> /// algorithm (but do not block). Called by computeNewSpeed whenever a new speed neds to be</span>
<a name="l00277"></a>00277 <span class="comment"> /// computed. </span>
<a name="l00278"></a>00278 <span class="comment"></span> <span class="keyword">virtual</span> <span class="keywordtype">float</span> <a class="code" href="classAccelStepper.html#6e4bd79c395e69beee31d76d0d3287e4">desiredSpeed</a>();
<a name="l00279"></a>00279
<a name="l00280"></a>00280 <span class="keyword">private</span>:<span class="comment"></span>
<a name="l00281"></a>00281 <span class="comment"> /// Number of pins on the stepper motor. Permits 2 or 4. 2 pins is a</span>
<a name="l00282"></a>00282 <span class="comment"> /// bipolar, and 4 pins is a unipolar.</span>
<a name="l00283"></a>00283 <span class="comment"></span> uint8_t _pins; <span class="comment">// 2 or 4</span>
<a name="l00284"></a>00284 <span class="comment"></span>
<a name="l00285"></a>00285 <span class="comment"> /// Arduino pin number for the 2 or 4 pins required to interface to the</span>
<a name="l00286"></a>00286 <span class="comment"> /// stepper motor.</span>
<a name="l00287"></a>00287 <span class="comment"></span> uint8_t _pin1, _pin2, _pin3, _pin4;
<a name="l00288"></a>00288 <span class="comment"></span>
<a name="l00289"></a>00289 <span class="comment"> /// The current absolution position in steps.</span>
<a name="l00290"></a>00290 <span class="comment"></span> <span class="keywordtype">long</span> _currentPos; <span class="comment">// Steps</span>
<a name="l00291"></a>00291 <span class="comment"></span>
<a name="l00292"></a>00292 <span class="comment"> /// The target position in steps. The AccelStepper library will move the</span>
<a name="l00293"></a>00293 <span class="comment"> /// motor from teh _currentPos to the _targetPos, taking into account the</span>
<a name="l00294"></a>00294 <span class="comment"> /// max speed, acceleration and deceleration</span>
<a name="l00295"></a>00295 <span class="comment"></span> <span class="keywordtype">long</span> _targetPos; <span class="comment">// Steps</span>
<a name="l00296"></a>00296 <span class="comment"></span>
<a name="l00297"></a>00297 <span class="comment"> /// The current motos speed in steps per second</span>
<a name="l00298"></a>00298 <span class="comment"> /// Positive is clockwise</span>
<a name="l00299"></a>00299 <span class="comment"></span> <span class="keywordtype">float</span> _speed; <span class="comment">// Steps per second</span>
<a name="l00300"></a>00300 <span class="comment"></span>
<a name="l00301"></a>00301 <span class="comment"> /// The maximum permitted speed in steps per second. Must be &gt; 0.</span>
<a name="l00302"></a>00302 <span class="comment"></span> <span class="keywordtype">float</span> _maxSpeed;
<a name="l00303"></a>00303 <span class="comment"></span>
<a name="l00304"></a>00304 <span class="comment"> /// The acceleration to use to accelerate or decelerate the motor in steps</span>
<a name="l00305"></a>00305 <span class="comment"> /// per second per second. Must be &gt; 0</span>
<a name="l00306"></a>00306 <span class="comment"></span> <span class="keywordtype">float</span> _acceleration;
<a name="l00307"></a>00307 <span class="comment"></span>
<a name="l00308"></a>00308 <span class="comment"> /// The current interval between steps in milliseconds.</span>
<a name="l00309"></a>00309 <span class="comment"></span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> _stepInterval;
<a name="l00310"></a>00310 <span class="comment"></span>
<a name="l00311"></a>00311 <span class="comment"> /// The last step time in milliseconds</span>
<a name="l00312"></a>00312 <span class="comment"></span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> _lastStepTime;
<a name="l00313"></a>00313 };
<a name="l00314"></a>00314
<a name="l00315"></a>00315 <span class="preprocessor">#endif </span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Oct 24 18:22:50 2010 for AccelStepper by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>

32
shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/annotated.html

@ -0,0 +1,32 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>AccelStepper: Class List</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li class="current"><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>Class List</h1>Here are the classes, structs, unions and interfaces with brief descriptions:<table>
<tr><td class="indexkey"><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td class="indexvalue">Support for stepper motors with acceleration etc </td></tr>
</table>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Oct 24 18:22:50 2010 for AccelStepper by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>

54
shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/classAccelStepper-members.html

@ -0,0 +1,54 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>AccelStepper: Member List</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>AccelStepper Member List</h1>This is the complete list of members for <a class="el" href="classAccelStepper.html">AccelStepper</a>, including all inherited members.<p><table>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#a1290897df35915069e5eca9d034038c">AccelStepper</a>(uint8_t pins=4, uint8_t pin1=2, uint8_t pin2=3, uint8_t pin3=4, uint8_t pin4=5)</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#ffbee789b5c19165846cf0409860ae79">computeNewSpeed</a>()</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td><code> [protected]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#5dce13ab2a1b02b8f443318886bf6fc5">currentPosition</a>()</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#6e4bd79c395e69beee31d76d0d3287e4">desiredSpeed</a>()</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td><code> [protected, virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#3591e29a236e2935afd7f64ff6c22006">disableOutputs</a>()</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#748665c3962e66fbc0e9373eb14c69c1">distanceToGo</a>()</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#a279a50d30d0413f570c692cff071643">enableOutputs</a>()</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#68942c66e78fb7f7b5f0cdade6eb7f06">move</a>(long relative)</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#ce236ede35f87c63d18da25810ec9736">moveTo</a>(long absolute)</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#608b2395b64ac15451d16d0371fe13ce">run</a>()</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#a4a6bdf99f698284faaeb5542b0b7514">runSpeed</a>()</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#9270d20336e76ac1fd5bcd5b9c34f301">runSpeedToPosition</a>()</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#176c5d2e4c2f21e9e92b12e39a6f0e67">runToNewPosition</a>(long position)</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#344f58fef8cc34ac5aa75ba4b665d21c">runToPosition</a>()</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#dfb19e3cd2a028a1fe78131787604fd1">setAcceleration</a>(float acceleration)</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#9d917f014317fb9d3b5dc14e66f6c689">setCurrentPosition</a>(long position)</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#bee8d466229b87accba33d6ec929c18f">setMaxSpeed</a>(float speed)</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#e79c49ad69d5ccc9da0ee691fa4ca235">setSpeed</a>(float speed)</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#4f0989d0ae264e7eadfe1fa720769fb6">speed</a>()</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#3c9a220819d2451f79ff8a0c0a395b9f">step</a>(uint8_t step)</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td><code> [protected, virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#cc64254ea242b53588e948335fd9305f">step1</a>(uint8_t step)</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td><code> [protected, virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#88f11bf6361fe002585f731d34fe2e8b">step2</a>(uint8_t step)</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td><code> [protected, virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#49e448d179bbe4e0f8003a3f9993789d">step4</a>(uint8_t step)</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td><code> [protected, virtual]</code></td></tr>
<tr class="memlist"><td><a class="el" href="classAccelStepper.html#96685e0945b7cf75d5959da679cd911e">targetPosition</a>()</td><td><a class="el" href="classAccelStepper.html">AccelStepper</a></td><td></td></tr>
</table></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Oct 24 18:22:50 2010 for AccelStepper by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>

723
shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/classAccelStepper.html

@ -0,0 +1,723 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>AccelStepper: AccelStepper Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>AccelStepper Class Reference</h1><!-- doxytag: class="AccelStepper" -->Support for stepper motors with acceleration etc.
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="AccelStepper_8h-source.html">AccelStepper.h</a>&gt;</code>
<p>
<p>
<a href="classAccelStepper-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a1290897df35915069e5eca9d034038c">AccelStepper</a> (uint8_t pins=4, uint8_t pin1=2, uint8_t pin2=3, uint8_t pin3=4, uint8_t pin4=5)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#ce236ede35f87c63d18da25810ec9736">moveTo</a> (long absolute)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#68942c66e78fb7f7b5f0cdade6eb7f06">move</a> (long relative)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">boolean&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#608b2395b64ac15451d16d0371fe13ce">run</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">boolean&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a4a6bdf99f698284faaeb5542b0b7514">runSpeed</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#bee8d466229b87accba33d6ec929c18f">setMaxSpeed</a> (float speed)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#dfb19e3cd2a028a1fe78131787604fd1">setAcceleration</a> (float acceleration)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#e79c49ad69d5ccc9da0ee691fa4ca235">setSpeed</a> (float speed)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">float&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#4f0989d0ae264e7eadfe1fa720769fb6">speed</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#748665c3962e66fbc0e9373eb14c69c1">distanceToGo</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#96685e0945b7cf75d5959da679cd911e">targetPosition</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#5dce13ab2a1b02b8f443318886bf6fc5">currentPosition</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#9d917f014317fb9d3b5dc14e66f6c689">setCurrentPosition</a> (long position)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#344f58fef8cc34ac5aa75ba4b665d21c">runToPosition</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">boolean&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#9270d20336e76ac1fd5bcd5b9c34f301">runSpeedToPosition</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#176c5d2e4c2f21e9e92b12e39a6f0e67">runToNewPosition</a> (long position)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#3591e29a236e2935afd7f64ff6c22006">disableOutputs</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a279a50d30d0413f570c692cff071643">enableOutputs</a> ()</td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#ffbee789b5c19165846cf0409860ae79">computeNewSpeed</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#3c9a220819d2451f79ff8a0c0a395b9f">step</a> (uint8_t step)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#cc64254ea242b53588e948335fd9305f">step1</a> (uint8_t step)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#88f11bf6361fe002585f731d34fe2e8b">step2</a> (uint8_t step)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#49e448d179bbe4e0f8003a3f9993789d">step4</a> (uint8_t step)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual float&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#6e4bd79c395e69beee31d76d0d3287e4">desiredSpeed</a> ()</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Support for stepper motors with acceleration etc.
<p>
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.<p>
<dl class="user" compact><dt><b>Operation</b></dt><dd>This module operates by computing a step time in milliseconds. 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 milliseconds. The <a class="el" href="classAccelStepper.html#608b2395b64ac15451d16d0371fe13ce">run()</a> function steps the motor if a new step is due. The <a class="el" href="classAccelStepper.html#608b2395b64ac15451d16d0371fe13ce">run()</a> function must be called frequently until the motor is in the desired position, after which time <a class="el" href="classAccelStepper.html#608b2395b64ac15451d16d0371fe13ce">run()</a> will do nothing.</dd></dl>
<dl class="user" compact><dt><b>Positioning</b></dt><dd>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 curent position can be altered for instance after initialization positioning.</dd></dl>
<dl class="user" compact><dt><b>Caveats</b></dt><dd>This is an open loop controller: If the motor stalls or is oversped, <a class="el" href="classAccelStepper.html" title="Support for stepper motors with acceleration etc.">AccelStepper</a> 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).</dd></dl>
The fastest motor speed that can be reliably supported is 1000 steps per second (1 step every millisecond). However any speed less than that down to very slow speeds (much less than one per second) are supported, provided the <a class="el" href="classAccelStepper.html#608b2395b64ac15451d16d0371fe13ce">run()</a> function is called frequently enough to step the motor whenever required. <hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="a1290897df35915069e5eca9d034038c"></a><!-- doxytag: member="AccelStepper::AccelStepper" ref="a1290897df35915069e5eca9d034038c" args="(uint8_t pins=4, uint8_t pin1=2, uint8_t pin2=3, uint8_t pin3=4, uint8_t pin4=5)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">AccelStepper::AccelStepper </td>
<td>(</td>
<td class="paramtype">uint8_t&nbsp;</td>
<td class="paramname"> <em>pins</em> = <code>4</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&nbsp;</td>
<td class="paramname"> <em>pin1</em> = <code>2</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&nbsp;</td>
<td class="paramname"> <em>pin2</em> = <code>3</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&nbsp;</td>
<td class="paramname"> <em>pin3</em> = <code>4</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&nbsp;</td>
<td class="paramname"> <em>pin4</em> = <code>5</code></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Constructor. You can have multiple simultaneous steppers, all moving at different speeds and accelerations, provided you call their <a class="el" href="classAccelStepper.html#608b2395b64ac15451d16d0371fe13ce">run()</a> 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 <a class="el" href="classAccelStepper.html#a279a50d30d0413f570c692cff071643">enableOutputs()</a>. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>pins</em>&nbsp;</td><td>Number of pins to interface to. 1, 2 or 4 are supported. 1 means a stepper driver (with Step and Direction pins) 2 means a 2 wire stepper. 4 means a 4 wire stepper. Defaults to 4 pins. </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>pin1</em>&nbsp;</td><td>Arduino digital pin number for motor pin 1. Defaults to pin 2. For a driver (pins==1), this is the Step input to the driver. Low to high transition means to step) </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>pin2</em>&nbsp;</td><td>Arduino digital pin number for motor pin 2. Defaults to pin 3. For a driver (pins==1), this is the Direction input the driver. High means forward. </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>pin3</em>&nbsp;</td><td>Arduino digital pin number for motor pin 3. Defaults to pin 4. </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>pin4</em>&nbsp;</td><td>Arduino digital pin number for motor pin 4. Defaults to pin 5. </td></tr>
</table>
</dl>
<p>References <a class="el" href="AccelStepper_8cpp-source.html#l00287">enableOutputs()</a>.</p>
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="ce236ede35f87c63d18da25810ec9736"></a><!-- doxytag: member="AccelStepper::moveTo" ref="ce236ede35f87c63d18da25810ec9736" args="(long absolute)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::moveTo </td>
<td>(</td>
<td class="paramtype">long&nbsp;</td>
<td class="paramname"> <em>absolute</em> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Set the target position. The <a class="el" href="classAccelStepper.html#608b2395b64ac15451d16d0371fe13ce">run()</a> function will try to move the motor from the current position to the target position set by the most recent call to this function. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>absolute</em>&nbsp;</td><td>The desired absolute position. Negative is anticlockwise from the 0 position. </td></tr>
</table>
</dl>
<p>References <a class="el" href="AccelStepper_8cpp-source.html#l00069">computeNewSpeed()</a>.</p>
<p>Referenced by <a class="el" href="AccelStepper_8cpp-source.html#l00015">move()</a>, and <a class="el" href="AccelStepper_8cpp-source.html#l00311">runToNewPosition()</a>.</p>
</div>
</div><p>
<a class="anchor" name="68942c66e78fb7f7b5f0cdade6eb7f06"></a><!-- doxytag: member="AccelStepper::move" ref="68942c66e78fb7f7b5f0cdade6eb7f06" args="(long relative)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::move </td>
<td>(</td>
<td class="paramtype">long&nbsp;</td>
<td class="paramname"> <em>relative</em> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Set the target position relative to the current position <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>relative</em>&nbsp;</td><td>The desired position relative to the current position. Negative is anticlockwise from the current position. </td></tr>
</table>
</dl>
<p>References <a class="el" href="AccelStepper_8cpp-source.html#l00009">moveTo()</a>.</p>
</div>
</div><p>
<a class="anchor" name="608b2395b64ac15451d16d0371fe13ce"></a><!-- doxytag: member="AccelStepper::run" ref="608b2395b64ac15451d16d0371fe13ce" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">boolean AccelStepper::run </td>
<td>(</td>
<td class="paramname"> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Poll the motor and step it if a step is due, implementing accelerations and decelerations to achive the ratget position. You must call this as fequently as possible, but at least once per minimum step interval, preferably in your main loop. <dl class="return" compact><dt><b>Returns:</b></dt><dd>true if the motor is at the target position. </dd></dl>
<p>References <a class="el" href="AccelStepper_8cpp-source.html#l00069">computeNewSpeed()</a>, and <a class="el" href="AccelStepper_8cpp-source.html#l00023">runSpeed()</a>.</p>
<p>Referenced by <a class="el" href="AccelStepper_8cpp-source.html#l00299">runToPosition()</a>.</p>
</div>
</div><p>
<a class="anchor" name="a4a6bdf99f698284faaeb5542b0b7514"></a><!-- doxytag: member="AccelStepper::runSpeed" ref="a4a6bdf99f698284faaeb5542b0b7514" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">boolean AccelStepper::runSpeed </td>
<td>(</td>
<td class="paramname"> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Poll the motor and step it if a step is due, implmenting a constant speed as set by the most recent call to <a class="el" href="classAccelStepper.html#e79c49ad69d5ccc9da0ee691fa4ca235">setSpeed()</a>. <dl class="return" compact><dt><b>Returns:</b></dt><dd>true if the motor was stepped. </dd></dl>
<p>References <a class="el" href="AccelStepper_8cpp-source.html#l00176">step()</a>.</p>
<p>Referenced by <a class="el" href="AccelStepper_8cpp-source.html#l00125">run()</a>, and <a class="el" href="AccelStepper_8cpp-source.html#l00305">runSpeedToPosition()</a>.</p>
</div>
</div><p>
<a class="anchor" name="bee8d466229b87accba33d6ec929c18f"></a><!-- doxytag: member="AccelStepper::setMaxSpeed" ref="bee8d466229b87accba33d6ec929c18f" args="(float speed)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::setMaxSpeed </td>
<td>(</td>
<td class="paramtype">float&nbsp;</td>
<td class="paramname"> <em>speed</em> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Sets the maximum permitted speed. the <a class="el" href="classAccelStepper.html#608b2395b64ac15451d16d0371fe13ce">run()</a> function will accelerate up to the speed set by this function. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>speed</em>&nbsp;</td><td>The desired maximum speed in steps per second. Must be &gt; 0. Speeds of more than 1000 steps per second are unreliable. </td></tr>
</table>
</dl>
<p>References <a class="el" href="AccelStepper_8cpp-source.html#l00069">computeNewSpeed()</a>.</p>
</div>
</div><p>
<a class="anchor" name="dfb19e3cd2a028a1fe78131787604fd1"></a><!-- doxytag: member="AccelStepper::setAcceleration" ref="dfb19e3cd2a028a1fe78131787604fd1" args="(float acceleration)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::setAcceleration </td>
<td>(</td>
<td class="paramtype">float&nbsp;</td>
<td class="paramname"> <em>acceleration</em> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Sets the acceleration and deceleration parameter. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>acceleration</em>&nbsp;</td><td>The desired acceleration in steps per second per second. Must be &gt; 0. </td></tr>
</table>
</dl>
<p>References <a class="el" href="AccelStepper_8cpp-source.html#l00069">computeNewSpeed()</a>.</p>
</div>
</div><p>
<a class="anchor" name="e79c49ad69d5ccc9da0ee691fa4ca235"></a><!-- doxytag: member="AccelStepper::setSpeed" ref="e79c49ad69d5ccc9da0ee691fa4ca235" args="(float speed)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::setSpeed </td>
<td>(</td>
<td class="paramtype">float&nbsp;</td>
<td class="paramname"> <em>speed</em> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Sets the desired constant speed for use with <a class="el" href="classAccelStepper.html#a4a6bdf99f698284faaeb5542b0b7514">runSpeed()</a>. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>speed</em>&nbsp;</td><td>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 <a class="el" href="classAccelStepper.html#a4a6bdf99f698284faaeb5542b0b7514">runSpeed()</a> function. </td></tr>
</table>
</dl>
<p>Referenced by <a class="el" href="AccelStepper_8cpp-source.html#l00069">computeNewSpeed()</a>.</p>
</div>
</div><p>
<a class="anchor" name="4f0989d0ae264e7eadfe1fa720769fb6"></a><!-- doxytag: member="AccelStepper::speed" ref="4f0989d0ae264e7eadfe1fa720769fb6" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">float AccelStepper::speed </td>
<td>(</td>
<td class="paramname"> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
The most recently set speed <dl class="return" compact><dt><b>Returns:</b></dt><dd>the most recent speed in steps per second </dd></dl>
</div>
</div><p>
<a class="anchor" name="748665c3962e66fbc0e9373eb14c69c1"></a><!-- doxytag: member="AccelStepper::distanceToGo" ref="748665c3962e66fbc0e9373eb14c69c1" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">long AccelStepper::distanceToGo </td>
<td>(</td>
<td class="paramname"> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
The distance from the current position to the target position. <dl class="return" compact><dt><b>Returns:</b></dt><dd>the distance from the current position to the target position in steps. Positive is clockwise from the current position. </dd></dl>
<p>Referenced by <a class="el" href="AccelStepper_8cpp-source.html#l00084">desiredSpeed()</a>.</p>
</div>
</div><p>
<a class="anchor" name="96685e0945b7cf75d5959da679cd911e"></a><!-- doxytag: member="AccelStepper::targetPosition" ref="96685e0945b7cf75d5959da679cd911e" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">long AccelStepper::targetPosition </td>
<td>(</td>
<td class="paramname"> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
The most recently set target position. <dl class="return" compact><dt><b>Returns:</b></dt><dd>the target position in steps. Positive is clockwise from the 0 position. </dd></dl>
</div>
</div><p>
<a class="anchor" name="5dce13ab2a1b02b8f443318886bf6fc5"></a><!-- doxytag: member="AccelStepper::currentPosition" ref="5dce13ab2a1b02b8f443318886bf6fc5" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">long AccelStepper::currentPosition </td>
<td>(</td>
<td class="paramname"> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
The currently motor position. <dl class="return" compact><dt><b>Returns:</b></dt><dd>the current motor position in steps. Positive is clockwise from the 0 position. </dd></dl>
</div>
</div><p>
<a class="anchor" name="9d917f014317fb9d3b5dc14e66f6c689"></a><!-- doxytag: member="AccelStepper::setCurrentPosition" ref="9d917f014317fb9d3b5dc14e66f6c689" args="(long position)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::setCurrentPosition </td>
<td>(</td>
<td class="paramtype">long&nbsp;</td>
<td class="paramname"> <em>position</em> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Resets the current position of the motor, so that wherever the mottor happens to be right now is considered to be the new position. Useful for setting a zero position on a stepper after an initial hardware positioning move. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>position</em>&nbsp;</td><td>The position in steps of wherever the motor happens to be right now. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="344f58fef8cc34ac5aa75ba4b665d21c"></a><!-- doxytag: member="AccelStepper::runToPosition" ref="344f58fef8cc34ac5aa75ba4b665d21c" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::runToPosition </td>
<td>(</td>
<td class="paramname"> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Moves the motor to the target position and blocks until it is at position. Dont use this in event loops, since it blocks.
<p>References <a class="el" href="AccelStepper_8cpp-source.html#l00125">run()</a>.</p>
<p>Referenced by <a class="el" href="AccelStepper_8cpp-source.html#l00311">runToNewPosition()</a>.</p>
</div>
</div><p>
<a class="anchor" name="9270d20336e76ac1fd5bcd5b9c34f301"></a><!-- doxytag: member="AccelStepper::runSpeedToPosition" ref="9270d20336e76ac1fd5bcd5b9c34f301" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">boolean AccelStepper::runSpeedToPosition </td>
<td>(</td>
<td class="paramname"> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Runs at the currently selected speed until the target position is reached Does not implement accelerations.
<p>References <a class="el" href="AccelStepper_8cpp-source.html#l00023">runSpeed()</a>.</p>
</div>
</div><p>
<a class="anchor" name="176c5d2e4c2f21e9e92b12e39a6f0e67"></a><!-- doxytag: member="AccelStepper::runToNewPosition" ref="176c5d2e4c2f21e9e92b12e39a6f0e67" args="(long position)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::runToNewPosition </td>
<td>(</td>
<td class="paramtype">long&nbsp;</td>
<td class="paramname"> <em>position</em> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Moves the motor to the new target position and blocks until it is at position. Dont use this in event loops, since it blocks. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>position</em>&nbsp;</td><td>The new target position. </td></tr>
</table>
</dl>
<p>References <a class="el" href="AccelStepper_8cpp-source.html#l00009">moveTo()</a>, and <a class="el" href="AccelStepper_8cpp-source.html#l00299">runToPosition()</a>.</p>
</div>
</div><p>
<a class="anchor" name="3591e29a236e2935afd7f64ff6c22006"></a><!-- doxytag: member="AccelStepper::disableOutputs" ref="3591e29a236e2935afd7f64ff6c22006" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::disableOutputs </td>
<td>(</td>
<td class="paramname"> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
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 <a class="el" href="classAccelStepper.html#a279a50d30d0413f570c692cff071643">enableOutputs()</a> before stepping again.
</div>
</div><p>
<a class="anchor" name="a279a50d30d0413f570c692cff071643"></a><!-- doxytag: member="AccelStepper::enableOutputs" ref="a279a50d30d0413f570c692cff071643" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::enableOutputs </td>
<td>(</td>
<td class="paramname"> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Enable motor pin outputs by setting the motor pins to OUTPUT mode. Called automatically by the constructor.
<p>Referenced by <a class="el" href="AccelStepper_8cpp-source.html#l00135">AccelStepper()</a>.</p>
</div>
</div><p>
<a class="anchor" name="ffbee789b5c19165846cf0409860ae79"></a><!-- doxytag: member="AccelStepper::computeNewSpeed" ref="ffbee789b5c19165846cf0409860ae79" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::computeNewSpeed </td>
<td>(</td>
<td class="paramname"> </td>
<td>&nbsp;)&nbsp;</td>
<td><code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Forces the library to compute a new instantaneous speed and set that as the current speed. Calls <a class="el" href="classAccelStepper.html#6e4bd79c395e69beee31d76d0d3287e4">desiredSpeed()</a>, which can be overridden by subclasses. It is called by the library: <ul>
<li>after each step </li>
<li>after change to maxSpeed through <a class="el" href="classAccelStepper.html#bee8d466229b87accba33d6ec929c18f">setMaxSpeed()</a> </li>
<li>after change to acceleration through <a class="el" href="classAccelStepper.html#dfb19e3cd2a028a1fe78131787604fd1">setAcceleration()</a> </li>
<li>after change to target position (relative or absolute) through <a class="el" href="classAccelStepper.html#68942c66e78fb7f7b5f0cdade6eb7f06">move()</a> or <a class="el" href="classAccelStepper.html#ce236ede35f87c63d18da25810ec9736">moveTo()</a> </li>
</ul>
<p>References <a class="el" href="AccelStepper_8cpp-source.html#l00084">desiredSpeed()</a>, and <a class="el" href="AccelStepper_8cpp-source.html#l00164">setSpeed()</a>.</p>
<p>Referenced by <a class="el" href="AccelStepper_8cpp-source.html#l00009">moveTo()</a>, <a class="el" href="AccelStepper_8cpp-source.html#l00125">run()</a>, <a class="el" href="AccelStepper_8cpp-source.html#l00158">setAcceleration()</a>, and <a class="el" href="AccelStepper_8cpp-source.html#l00152">setMaxSpeed()</a>.</p>
</div>
</div><p>
<a class="anchor" name="3c9a220819d2451f79ff8a0c0a395b9f"></a><!-- doxytag: member="AccelStepper::step" ref="3c9a220819d2451f79ff8a0c0a395b9f" args="(uint8_t step)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::step </td>
<td>(</td>
<td class="paramtype">uint8_t&nbsp;</td>
<td class="paramname"> <em>step</em> </td>
<td>&nbsp;)&nbsp;</td>
<td><code> [protected, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Called to execute a step. Only called when a new step is required. Subclasses may override to implement new stepping interfaces. The default calls <a class="el" href="classAccelStepper.html#cc64254ea242b53588e948335fd9305f">step1()</a>, <a class="el" href="classAccelStepper.html#88f11bf6361fe002585f731d34fe2e8b">step2()</a> or <a class="el" href="classAccelStepper.html#49e448d179bbe4e0f8003a3f9993789d">step4()</a> depending on the number of pins defined for the stepper. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>step</em>&nbsp;</td><td>The current step phase number (0 to 3) </td></tr>
</table>
</dl>
<p>References <a class="el" href="AccelStepper_8cpp-source.html#l00197">step1()</a>, <a class="el" href="AccelStepper_8cpp-source.html#l00211">step2()</a>, and <a class="el" href="AccelStepper_8cpp-source.html#l00240">step4()</a>.</p>
<p>Referenced by <a class="el" href="AccelStepper_8cpp-source.html#l00023">runSpeed()</a>.</p>
</div>
</div><p>
<a class="anchor" name="cc64254ea242b53588e948335fd9305f"></a><!-- doxytag: member="AccelStepper::step1" ref="cc64254ea242b53588e948335fd9305f" args="(uint8_t step)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::step1 </td>
<td>(</td>
<td class="paramtype">uint8_t&nbsp;</td>
<td class="paramname"> <em>step</em> </td>
<td>&nbsp;)&nbsp;</td>
<td><code> [protected, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Called to execute a step on a stepper drover (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. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>step</em>&nbsp;</td><td>The current step phase number (0 to 3) </td></tr>
</table>
</dl>
<p>Referenced by <a class="el" href="AccelStepper_8cpp-source.html#l00176">step()</a>.</p>
</div>
</div><p>
<a class="anchor" name="88f11bf6361fe002585f731d34fe2e8b"></a><!-- doxytag: member="AccelStepper::step2" ref="88f11bf6361fe002585f731d34fe2e8b" args="(uint8_t step)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::step2 </td>
<td>(</td>
<td class="paramtype">uint8_t&nbsp;</td>
<td class="paramname"> <em>step</em> </td>
<td>&nbsp;)&nbsp;</td>
<td><code> [protected, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
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 <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>step</em>&nbsp;</td><td>The current step phase number (0 to 3) </td></tr>
</table>
</dl>
<p>Referenced by <a class="el" href="AccelStepper_8cpp-source.html#l00176">step()</a>.</p>
</div>
</div><p>
<a class="anchor" name="49e448d179bbe4e0f8003a3f9993789d"></a><!-- doxytag: member="AccelStepper::step4" ref="49e448d179bbe4e0f8003a3f9993789d" args="(uint8_t step)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::step4 </td>
<td>(</td>
<td class="paramtype">uint8_t&nbsp;</td>
<td class="paramname"> <em>step</em> </td>
<td>&nbsp;)&nbsp;</td>
<td><code> [protected, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
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. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>step</em>&nbsp;</td><td>The current step phase number (0 to 3) </td></tr>
</table>
</dl>
<p>Referenced by <a class="el" href="AccelStepper_8cpp-source.html#l00176">step()</a>.</p>
</div>
</div><p>
<a class="anchor" name="6e4bd79c395e69beee31d76d0d3287e4"></a><!-- doxytag: member="AccelStepper::desiredSpeed" ref="6e4bd79c395e69beee31d76d0d3287e4" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">float AccelStepper::desiredSpeed </td>
<td>(</td>
<td class="paramname"> </td>
<td>&nbsp;)&nbsp;</td>
<td><code> [protected, virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Compute and return the desired speed. The default algorithm uses maxSpeed, acceleration and the current speed to set a new speed to move the motor from teh current position to the target position. Subclasses may override this to provide an alternate algorithm (but do not block). Called by computeNewSpeed whenever a new speed neds to be computed.
<p>References <a class="el" href="AccelStepper_8cpp-source.html#l00048">distanceToGo()</a>.</p>
<p>Referenced by <a class="el" href="AccelStepper_8cpp-source.html#l00069">computeNewSpeed()</a>.</p>
</div>
</div><p>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="AccelStepper_8h-source.html">AccelStepper.h</a><li>AccelStepper.cpp</ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Oct 24 18:22:50 2010 for AccelStepper by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>

473
shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/doxygen.css

@ -0,0 +1,473 @@
BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
font-family: Geneva, Arial, Helvetica, sans-serif;
}
BODY,TD {
font-size: 90%;
}
H1 {
text-align: center;
font-size: 160%;
}
H2 {
font-size: 120%;
}
H3 {
font-size: 100%;
}
CAPTION {
font-weight: bold
}
DIV.qindex {
width: 100%;
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
padding: 2px;
line-height: 140%;
}
DIV.navpath {
width: 100%;
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
padding: 2px;
line-height: 140%;
}
DIV.navtab {
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
margin-right: 15px;
padding: 2px;
}
TD.navtab {
font-size: 70%;
}
A.qindex {
text-decoration: none;
font-weight: bold;
color: #1A419D;
}
A.qindex:visited {
text-decoration: none;
font-weight: bold;
color: #1A419D
}
A.qindex:hover {
text-decoration: none;
background-color: #ddddff;
}
A.qindexHL {
text-decoration: none;
font-weight: bold;
background-color: #6666cc;
color: #ffffff;
border: 1px double #9295C2;
}
A.qindexHL:hover {
text-decoration: none;
background-color: #6666cc;
color: #ffffff;
}
A.qindexHL:visited {
text-decoration: none;
background-color: #6666cc;
color: #ffffff
}
A.el {
text-decoration: none;
font-weight: bold
}
A.elRef {
font-weight: bold
}
A.code:link {
text-decoration: none;
font-weight: normal;
color: #0000FF
}
A.code:visited {
text-decoration: none;
font-weight: normal;
color: #0000FF
}
A.codeRef:link {
font-weight: normal;
color: #0000FF
}
A.codeRef:visited {
font-weight: normal;
color: #0000FF
}
A:hover {
text-decoration: none;
background-color: #f2f2ff
}
DL.el {
margin-left: -1cm
}
.fragment {
font-family: monospace, fixed;
font-size: 95%;
}
PRE.fragment {
border: 1px solid #CCCCCC;
background-color: #f5f5f5;
margin-top: 4px;
margin-bottom: 4px;
margin-left: 2px;
margin-right: 8px;
padding-left: 6px;
padding-right: 6px;
padding-top: 4px;
padding-bottom: 4px;
}
DIV.ah {
background-color: black;
font-weight: bold;
color: #ffffff;
margin-bottom: 3px;
margin-top: 3px
}
DIV.groupHeader {
margin-left: 16px;
margin-top: 12px;
margin-bottom: 6px;
font-weight: bold;
}
DIV.groupText {
margin-left: 16px;
font-style: italic;
font-size: 90%
}
BODY {
background: white;
color: black;
margin-right: 20px;
margin-left: 20px;
}
TD.indexkey {
background-color: #e8eef2;
font-weight: bold;
padding-right : 10px;
padding-top : 2px;
padding-left : 10px;
padding-bottom : 2px;
margin-left : 0px;
margin-right : 0px;
margin-top : 2px;
margin-bottom : 2px;
border: 1px solid #CCCCCC;
}
TD.indexvalue {
background-color: #e8eef2;
font-style: italic;
padding-right : 10px;
padding-top : 2px;
padding-left : 10px;
padding-bottom : 2px;
margin-left : 0px;
margin-right : 0px;
margin-top : 2px;
margin-bottom : 2px;
border: 1px solid #CCCCCC;
}
TR.memlist {
background-color: #f0f0f0;
}
P.formulaDsp {
text-align: center;
}
IMG.formulaDsp {
}
IMG.formulaInl {
vertical-align: middle;
}
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 }
.mdescLeft {
padding: 0px 8px 4px 8px;
font-size: 80%;
font-style: italic;
background-color: #FAFAFA;
border-top: 1px none #E0E0E0;
border-right: 1px none #E0E0E0;
border-bottom: 1px none #E0E0E0;
border-left: 1px none #E0E0E0;
margin: 0px;
}
.mdescRight {
padding: 0px 8px 4px 8px;
font-size: 80%;
font-style: italic;
background-color: #FAFAFA;
border-top: 1px none #E0E0E0;
border-right: 1px none #E0E0E0;
border-bottom: 1px none #E0E0E0;
border-left: 1px none #E0E0E0;
margin: 0px;
}
.memItemLeft {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memItemRight {
padding: 1px 8px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memTemplItemLeft {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memTemplItemRight {
padding: 1px 8px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memTemplParams {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
color: #606060;
background-color: #FAFAFA;
font-size: 80%;
}
.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%;
}
a {
color: #1A41A8;
}
a:visited {
color: #2A3798;
}
.dirtab {
padding: 4px;
border-collapse: collapse;
border: 1px solid #84b0c7;
}
TH.dirtab {
background: #e8eef2;
font-weight: bold;
}
HR {
height: 1px;
border: none;
border-top: 1px solid black;
}
/* Style for detailed member documentation */
.memtemplate {
font-size: 80%;
color: #606060;
font-weight: normal;
margin-left: 3px;
}
.memnav {
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
margin-right: 15px;
padding: 2px;
}
.memitem {
padding: 4px;
background-color: #eef3f5;
border-width: 1px;
border-style: solid;
border-color: #dedeee;
-moz-border-radius: 8px 8px 8px 8px;
}
.memname {
white-space: nowrap;
font-weight: bold;
}
.memdoc{
padding-left: 10px;
}
.memproto {
background-color: #d5e1e8;
width: 100%;
border-width: 1px;
border-style: solid;
border-color: #84b0c7;
font-weight: bold;
-moz-border-radius: 8px 8px 8px 8px;
}
.paramkey {
text-align: right;
}
.paramtype {
white-space: nowrap;
}
.paramname {
color: #602020;
font-style: italic;
white-space: nowrap;
}
/* End Styling for detailed member documentation */
/* for the tree view */
.ftvtree {
font-family: sans-serif;
margin:0.5em;
}
/* these are for tree view when used as main index */
.directory {
font-size: 9pt;
font-weight: bold;
}
.directory h3 {
margin: 0px;
margin-top: 1em;
font-size: 11pt;
}
/* The following two styles can be used to replace the root node title */
/* with an image of your choice. Simply uncomment the next two styles, */
/* specify the name of your image and be sure to set 'height' to the */
/* proper pixel height of your image. */
/* .directory h3.swap { */
/* height: 61px; */
/* background-repeat: no-repeat; */
/* background-image: url("yourimage.gif"); */
/* } */
/* .directory h3.swap span { */
/* display: none; */
/* } */
.directory > h3 {
margin-top: 0;
}
.directory p {
margin: 0px;
white-space: nowrap;
}
.directory div {
display: none;
margin: 0px;
}
.directory img {
vertical-align: -30%;
}
/* these are for tree view when not used as main index */
.directory-alt {
font-size: 100%;
font-weight: bold;
}
.directory-alt h3 {
margin: 0px;
margin-top: 1em;
font-size: 11pt;
}
.directory-alt > h3 {
margin-top: 0;
}
.directory-alt p {
margin: 0px;
white-space: nowrap;
}
.directory-alt div {
display: none;
margin: 0px;
}
.directory-alt img {
vertical-align: -30%;
}

BIN
shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/doxygen.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

26
shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/files.html

@ -0,0 +1,26 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>AccelStepper: File Index</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>File List</h1>Here is a list of all documented files with brief descriptions:<table>
<tr><td class="indexkey"><b>AccelStepper.h</b> <a href="AccelStepper_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr>
</table>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Oct 24 18:22:50 2010 for AccelStepper by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>

87
shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/functions.html

@ -0,0 +1,87 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>AccelStepper: Class Members</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li class="current"><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li class="current"><a href="functions.html"><span>All</span></a></li>
<li><a href="functions_func.html"><span>Functions</span></a></li>
</ul>
</div>
</div>
<div class="contents">
Here is a list of all documented class members with links to the class documentation for each member:
<p>
<ul>
<li>AccelStepper()
: <a class="el" href="classAccelStepper.html#a1290897df35915069e5eca9d034038c">AccelStepper</a>
<li>computeNewSpeed()
: <a class="el" href="classAccelStepper.html#ffbee789b5c19165846cf0409860ae79">AccelStepper</a>
<li>currentPosition()
: <a class="el" href="classAccelStepper.html#5dce13ab2a1b02b8f443318886bf6fc5">AccelStepper</a>
<li>desiredSpeed()
: <a class="el" href="classAccelStepper.html#6e4bd79c395e69beee31d76d0d3287e4">AccelStepper</a>
<li>disableOutputs()
: <a class="el" href="classAccelStepper.html#3591e29a236e2935afd7f64ff6c22006">AccelStepper</a>
<li>distanceToGo()
: <a class="el" href="classAccelStepper.html#748665c3962e66fbc0e9373eb14c69c1">AccelStepper</a>
<li>enableOutputs()
: <a class="el" href="classAccelStepper.html#a279a50d30d0413f570c692cff071643">AccelStepper</a>
<li>move()
: <a class="el" href="classAccelStepper.html#68942c66e78fb7f7b5f0cdade6eb7f06">AccelStepper</a>
<li>moveTo()
: <a class="el" href="classAccelStepper.html#ce236ede35f87c63d18da25810ec9736">AccelStepper</a>
<li>run()
: <a class="el" href="classAccelStepper.html#608b2395b64ac15451d16d0371fe13ce">AccelStepper</a>
<li>runSpeed()
: <a class="el" href="classAccelStepper.html#a4a6bdf99f698284faaeb5542b0b7514">AccelStepper</a>
<li>runSpeedToPosition()
: <a class="el" href="classAccelStepper.html#9270d20336e76ac1fd5bcd5b9c34f301">AccelStepper</a>
<li>runToNewPosition()
: <a class="el" href="classAccelStepper.html#176c5d2e4c2f21e9e92b12e39a6f0e67">AccelStepper</a>
<li>runToPosition()
: <a class="el" href="classAccelStepper.html#344f58fef8cc34ac5aa75ba4b665d21c">AccelStepper</a>
<li>setAcceleration()
: <a class="el" href="classAccelStepper.html#dfb19e3cd2a028a1fe78131787604fd1">AccelStepper</a>
<li>setCurrentPosition()
: <a class="el" href="classAccelStepper.html#9d917f014317fb9d3b5dc14e66f6c689">AccelStepper</a>
<li>setMaxSpeed()
: <a class="el" href="classAccelStepper.html#bee8d466229b87accba33d6ec929c18f">AccelStepper</a>
<li>setSpeed()
: <a class="el" href="classAccelStepper.html#e79c49ad69d5ccc9da0ee691fa4ca235">AccelStepper</a>
<li>speed()
: <a class="el" href="classAccelStepper.html#4f0989d0ae264e7eadfe1fa720769fb6">AccelStepper</a>
<li>step()
: <a class="el" href="classAccelStepper.html#3c9a220819d2451f79ff8a0c0a395b9f">AccelStepper</a>
<li>step1()
: <a class="el" href="classAccelStepper.html#cc64254ea242b53588e948335fd9305f">AccelStepper</a>
<li>step2()
: <a class="el" href="classAccelStepper.html#88f11bf6361fe002585f731d34fe2e8b">AccelStepper</a>
<li>step4()
: <a class="el" href="classAccelStepper.html#49e448d179bbe4e0f8003a3f9993789d">AccelStepper</a>
<li>targetPosition()
: <a class="el" href="classAccelStepper.html#96685e0945b7cf75d5959da679cd911e">AccelStepper</a>
</ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Oct 24 18:22:50 2010 for AccelStepper by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>

87
shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/functions_func.html

@ -0,0 +1,87 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>AccelStepper: Class Members - Functions</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li class="current"><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="functions.html"><span>All</span></a></li>
<li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
</ul>
</div>
</div>
<div class="contents">
&nbsp;
<p>
<ul>
<li>AccelStepper()
: <a class="el" href="classAccelStepper.html#a1290897df35915069e5eca9d034038c">AccelStepper</a>
<li>computeNewSpeed()
: <a class="el" href="classAccelStepper.html#ffbee789b5c19165846cf0409860ae79">AccelStepper</a>
<li>currentPosition()
: <a class="el" href="classAccelStepper.html#5dce13ab2a1b02b8f443318886bf6fc5">AccelStepper</a>
<li>desiredSpeed()
: <a class="el" href="classAccelStepper.html#6e4bd79c395e69beee31d76d0d3287e4">AccelStepper</a>
<li>disableOutputs()
: <a class="el" href="classAccelStepper.html#3591e29a236e2935afd7f64ff6c22006">AccelStepper</a>
<li>distanceToGo()
: <a class="el" href="classAccelStepper.html#748665c3962e66fbc0e9373eb14c69c1">AccelStepper</a>
<li>enableOutputs()
: <a class="el" href="classAccelStepper.html#a279a50d30d0413f570c692cff071643">AccelStepper</a>
<li>move()
: <a class="el" href="classAccelStepper.html#68942c66e78fb7f7b5f0cdade6eb7f06">AccelStepper</a>
<li>moveTo()
: <a class="el" href="classAccelStepper.html#ce236ede35f87c63d18da25810ec9736">AccelStepper</a>
<li>run()
: <a class="el" href="classAccelStepper.html#608b2395b64ac15451d16d0371fe13ce">AccelStepper</a>
<li>runSpeed()
: <a class="el" href="classAccelStepper.html#a4a6bdf99f698284faaeb5542b0b7514">AccelStepper</a>
<li>runSpeedToPosition()
: <a class="el" href="classAccelStepper.html#9270d20336e76ac1fd5bcd5b9c34f301">AccelStepper</a>
<li>runToNewPosition()
: <a class="el" href="classAccelStepper.html#176c5d2e4c2f21e9e92b12e39a6f0e67">AccelStepper</a>
<li>runToPosition()
: <a class="el" href="classAccelStepper.html#344f58fef8cc34ac5aa75ba4b665d21c">AccelStepper</a>
<li>setAcceleration()
: <a class="el" href="classAccelStepper.html#dfb19e3cd2a028a1fe78131787604fd1">AccelStepper</a>
<li>setCurrentPosition()
: <a class="el" href="classAccelStepper.html#9d917f014317fb9d3b5dc14e66f6c689">AccelStepper</a>
<li>setMaxSpeed()
: <a class="el" href="classAccelStepper.html#bee8d466229b87accba33d6ec929c18f">AccelStepper</a>
<li>setSpeed()
: <a class="el" href="classAccelStepper.html#e79c49ad69d5ccc9da0ee691fa4ca235">AccelStepper</a>
<li>speed()
: <a class="el" href="classAccelStepper.html#4f0989d0ae264e7eadfe1fa720769fb6">AccelStepper</a>
<li>step()
: <a class="el" href="classAccelStepper.html#3c9a220819d2451f79ff8a0c0a395b9f">AccelStepper</a>
<li>step1()
: <a class="el" href="classAccelStepper.html#cc64254ea242b53588e948335fd9305f">AccelStepper</a>
<li>step2()
: <a class="el" href="classAccelStepper.html#88f11bf6361fe002585f731d34fe2e8b">AccelStepper</a>
<li>step4()
: <a class="el" href="classAccelStepper.html#49e448d179bbe4e0f8003a3f9993789d">AccelStepper</a>
<li>targetPosition()
: <a class="el" href="classAccelStepper.html#96685e0945b7cf75d5959da679cd911e">AccelStepper</a>
</ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Oct 24 18:22:50 2010 for AccelStepper by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>

51
shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/index.html

@ -0,0 +1,51 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>AccelStepper: AccelStepper library for Arduino</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li class="current"><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>AccelStepper library for Arduino</h1>
<p>
This is the Arduino <a class="el" href="classAccelStepper.html" title="Support for stepper motors with acceleration etc.">AccelStepper</a> 1.2 library. It provides an object-oriented interface for 2 or 4 pin stepper motors.<p>
The standard Arduino IDE includes the Stepper library (<a href="http://arduino.cc/en/Reference/Stepper">http://arduino.cc/en/Reference/Stepper</a>) for stepper motors. It is perfectly adequate for simple, single motor applications.<p>
<a class="el" href="classAccelStepper.html" title="Support for stepper motors with acceleration etc.">AccelStepper</a> significantly improves on the standard Arduino Stepper library in several ways: <ul>
<li>Supports acceleration and deceleration </li>
<li>Supports multiple simultaneous steppers, with independent concurrent stepping on each stepper </li>
<li>API functions never delay() or block </li>
<li>Supports 2 and 4 wire steppers </li>
<li>Supports stepper drivers such as the Sparkfun EasyDriver (based on 3967 driver chip) </li>
<li>Very slow speeds are supported </li>
<li>Extensive API </li>
<li>Subclass support</li>
</ul>
The latest version of this documentation can be downloaded from <a href="http://www.open.com.au/mikem/arduino/AccelStepper">http://www.open.com.au/mikem/arduino/AccelStepper</a><p>
Example Arduino programs are included to show the main modes of use.<p>
The version of the package that this documentation refers to can be downloaded from <a href="http://www.open.com.au/mikem/arduino/AccelStepper/AccelStepper-1.3.zip">http://www.open.com.au/mikem/arduino/AccelStepper/AccelStepper-1.3.zip</a> You can find the latest version at <a href="http://www.open.com.au/mikem/arduino/AccelStepper">http://www.open.com.au/mikem/arduino/AccelStepper</a><p>
Tested on Arduino Diecimila and Mega with arduino-0018 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.<p>
<dl class="user" compact><dt><b>Installation</b></dt><dd>Install in the usual way: unzip the distribution zip file to the libraries sub-folder of your sketchbook.</dd></dl>
This software is Copyright (C) 2010 Mike McCauley. Use is subject to license conditions. The main licensing options available are GPL V2 or Commercial:<p>
<dl class="user" compact><dt><b>Open Source Licensing GPL V2</b></dt><dd>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 <a href="http://www.gnu.org/copyleft/gpl.html">http://www.gnu.org/copyleft/gpl.html</a></dd></dl>
<dl class="user" compact><dt><b>Commercial Licensing</b></dt><dd>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 <a href="mailto:info@open.com.au">info@open.com.au</a> for details.</dd></dl>
<dl class="user" compact><dt><b>Revision History</b></dt><dd></dd></dl>
<dl class="version" compact><dt><b>Version:</b></dt><dd>1.0 Initial release<p>
1.1 Added speed() function to get the current speed. <p>
1.2 Added runSpeedToPosition() submitted by Gunnar Arndt. <p>
1.3 Added support for stepper drivers (ie with Step and Direction inputs) with _pins == 1</dd></dl>
<dl class="author" compact><dt><b>Author:</b></dt><dd>Mike McCauley (<a href="mailto:mikem@open.com.au">mikem@open.com.au</a>) </dd></dl>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Oct 24 18:22:50 2010 for AccelStepper by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>

BIN
shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/tab_b.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 B

BIN
shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/tab_l.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 706 B

BIN
shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/tab_r.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

102
shields/Adafruit Motor Shield v2.3/AccelStepper Library/doc/tabs.css

@ -0,0 +1,102 @@
/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */
DIV.tabs
{
float : left;
width : 100%;
background : url("tab_b.gif") repeat-x bottom;
margin-bottom : 4px;
}
DIV.tabs UL
{
margin : 0px;
padding-left : 10px;
list-style : none;
}
DIV.tabs LI, DIV.tabs FORM
{
display : inline;
margin : 0px;
padding : 0px;
}
DIV.tabs FORM
{
float : right;
}
DIV.tabs A
{
float : left;
background : url("tab_r.gif") no-repeat right top;
border-bottom : 1px solid #84B0C7;
font-size : x-small;
font-weight : bold;
text-decoration : none;
}
DIV.tabs A:hover
{
background-position: 100% -150px;
}
DIV.tabs A:link, DIV.tabs A:visited,
DIV.tabs A:active, DIV.tabs A:hover
{
color: #1A419D;
}
DIV.tabs SPAN
{
float : left;
display : block;
background : url("tab_l.gif") no-repeat left top;
padding : 5px 9px;
white-space : nowrap;
}
DIV.tabs INPUT
{
float : right;
display : inline;
font-size : 1em;
}
DIV.tabs TD
{
font-size : x-small;
font-weight : bold;
text-decoration : none;
}
/* Commented Backslash Hack hides rule from IE5-Mac \*/
DIV.tabs SPAN {float : none;}
/* End IE5-Mac hack */
DIV.tabs A:hover SPAN
{
background-position: 0% -150px;
}
DIV.tabs LI.current A
{
background-position: 100% -150px;
border-width : 0px;
}
DIV.tabs LI.current SPAN
{
background-position: 0% -150px;
padding-bottom : 6px;
}
DIV.navpath
{
background : none;
border : none;
border-bottom : 1px solid #84B0C7;
}

37
shields/Adafruit Motor Shield v2.3/AccelStepper Library/examples/AFMotor_ConstantSpeed/AFMotor_ConstantSpeed.pde

@ -0,0 +1,37 @@
// 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)
// And AccelStepper with AFMotor support (https://github.com/adafruit/AccelStepper)
// Public domain!
#include <AccelStepper.h>
#include <AFMotor.h>
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.setSpeed(50);
}
void loop()
{
stepper.runSpeed();
}

56
shields/Adafruit Motor Shield v2.3/AccelStepper Library/examples/AFMotor_MultiStepper/AFMotor_MultiStepper.pde

@ -0,0 +1,56 @@
// MultiStepper
// -*- 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)
// And AccelStepper with AFMotor support (https://github.com/adafruit/AccelStepper)
// Public domain!
#include <AccelStepper.h>
#include <AFMotor.h>
// 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();
}

28
shields/Adafruit Motor Shield v2.3/AccelStepper Library/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: HRFMessage.h,v 1.1 2009/08/15 05:32:58 mikem Exp mikem $
#include <AccelStepper.h>
// Define a stepper and the pins it will use
AccelStepper stepper; // Defaults to 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);
}

22
shields/Adafruit Motor Shield v2.3/AccelStepper Library/examples/ConstantSpeed/ConstantSpeed.pde

@ -0,0 +1,22 @@
// ConstantSpeed.pde
// -*- mode: C++ -*-
//
// Shows how to run AccelStepper in the simplest,
// fixed speed mode with no accelerations
/// \author Mike McCauley (mikem@open.com.au)
// Copyright (C) 2009 Mike McCauley
// $Id: HRFMessage.h,v 1.1 2009/08/15 05:32:58 mikem Exp mikem $
#include <AccelStepper.h>
AccelStepper stepper; // Defaults to 4 pins on 2, 3, 4, 5
void setup()
{
stepper.setSpeed(50);
}
void loop()
{
stepper.runSpeed();
}

41
shields/Adafruit Motor Shield v2.3/AccelStepper Library/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: HRFMessage.h,v 1.1 2009/08/15 05:32:58 mikem Exp mikem $
#include <AccelStepper.h>
// Define some steppers and the pins the will use
AccelStepper stepper1; // Defaults to 4 pins on 2, 3, 4, 5
AccelStepper stepper2(4, 6, 7, 8, 9);
AccelStepper stepper3(2, 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();
}

31
shields/Adafruit Motor Shield v2.3/AccelStepper Library/examples/Overshoot/Overshoot.pde

@ -0,0 +1,31 @@
// 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: HRFMessage.h,v 1.1 2009/08/15 05:32:58 mikem Exp mikem $
#include <AccelStepper.h>
// Define a stepper and the pins it will use
AccelStepper stepper; // Defaults to 4 pins on 2, 3, 4, 5
void setup()
{
}
void loop()
{
stepper.setMaxSpeed(200);
stepper.setAcceleration(50);
stepper.runToNewPosition(0);
stepper.moveTo(500);
while (stepper.currentPosition() != 300)
stepper.run();
// cause an overshoot as we whiz past 300
stepper.setCurrentPosition(600);
}

30
shields/Adafruit Motor Shield v2.3/AccelStepper Library/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: HRFMessage.h,v 1.1 2009/08/15 05:32:58 mikem Exp mikem $
#include <AccelStepper.h>
// Define a stepper and the pins it will use
AccelStepper stepper; // Defaults to 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();
}

1294
shields/Adafruit Motor Shield v2.3/AccelStepper Library/project.cfg

File diff suppressed because it is too large Load Diff

398
shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/Adafruit_MotorShield.cpp

@ -0,0 +1,398 @@
/******************************************************************
This is the library for the Adafruit Motor Shield V2 for Arduino.
It supports DC motors & Stepper motors with microstepping as well
as stacking-support. It is *not* compatible with the V1 library!
It will only work with https://www.adafruit.com/products/1483
Adafruit invests time and resources providing this open
source code, please support Adafruit and open-source hardware
by purchasing products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, check license.txt for more information.
All text above must be included in any redistribution.
******************************************************************/
#if (ARDUINO >= 100)
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include <Wire.h>
#include "Adafruit_MotorShield.h"
#include <Adafruit_MS_PWMServoDriver.h>
#if defined(ARDUINO_SAM_DUE)
#define WIRE Wire1
#else
#define WIRE Wire
#endif
#if (MICROSTEPS == 8)
uint8_t microstepcurve[] = {0, 50, 98, 142, 180, 212, 236, 250, 255};
#elif (MICROSTEPS == 16)
uint8_t microstepcurve[] = {0, 25, 50, 74, 98, 120, 141, 162, 180, 197, 212, 225, 236, 244, 250, 253, 255};
#endif
Adafruit_MotorShield::Adafruit_MotorShield(uint8_t addr) {
_addr = addr;
_pwm = Adafruit_MS_PWMServoDriver(_addr);
}
void Adafruit_MotorShield::begin(uint16_t freq) {
// init PWM w/_freq
WIRE.begin();
_pwm.begin();
_freq = freq;
_pwm.setPWMFreq(_freq); // This is the maximum PWM frequency
for (uint8_t i=0; i<16; i++)
_pwm.setPWM(i, 0, 0);
}
void Adafruit_MotorShield::setPWM(uint8_t pin, uint16_t value) {
if (value > 4095) {
_pwm.setPWM(pin, 4096, 0);
} else
_pwm.setPWM(pin, 0, value);
}
void Adafruit_MotorShield::setPin(uint8_t pin, boolean value) {
if (value == LOW)
_pwm.setPWM(pin, 0, 0);
else
_pwm.setPWM(pin, 4096, 0);
}
Adafruit_DCMotor *Adafruit_MotorShield::getMotor(uint8_t num) {
if (num > 4) return NULL;
num--;
if (dcmotors[num].motornum == 0) {
// not init'd yet!
dcmotors[num].motornum = num;
dcmotors[num].MC = this;
uint8_t pwm, in1, in2;
if (num == 0) {
pwm = 8; in2 = 9; in1 = 10;
} else if (num == 1) {
pwm = 13; in2 = 12; in1 = 11;
} else if (num == 2) {
pwm = 2; in2 = 3; in1 = 4;
} else if (num == 3) {
pwm = 7; in2 = 6; in1 = 5;
}
dcmotors[num].PWMpin = pwm;
dcmotors[num].IN1pin = in1;
dcmotors[num].IN2pin = in2;
}
return &dcmotors[num];
}
Adafruit_StepperMotor *Adafruit_MotorShield::getStepper(uint16_t steps, uint8_t num) {
if (num > 2) return NULL;
num--;
if (steppers[num].steppernum == 0) {
// not init'd yet!
steppers[num].steppernum = num;
steppers[num].revsteps = steps;
steppers[num].MC = this;
uint8_t pwma, pwmb, ain1, ain2, bin1, bin2;
if (num == 0) {
pwma = 8; ain2 = 9; ain1 = 10;
pwmb = 13; bin2 = 12; bin1 = 11;
} else if (num == 1) {
pwma = 2; ain2 = 3; ain1 = 4;
pwmb = 7; bin2 = 6; bin1 = 5;
}
steppers[num].PWMApin = pwma;
steppers[num].PWMBpin = pwmb;
steppers[num].AIN1pin = ain1;
steppers[num].AIN2pin = ain2;
steppers[num].BIN1pin = bin1;
steppers[num].BIN2pin = bin2;
}
return &steppers[num];
}
/******************************************
MOTORS
******************************************/
Adafruit_DCMotor::Adafruit_DCMotor(void) {
MC = NULL;
motornum = 0;
PWMpin = IN1pin = IN2pin = 0;
}
void Adafruit_DCMotor::run(uint8_t cmd) {
switch (cmd) {
case FORWARD:
MC->setPin(IN2pin, LOW); // take low first to avoid 'break'
MC->setPin(IN1pin, HIGH);
break;
case BACKWARD:
MC->setPin(IN1pin, LOW); // take low first to avoid 'break'
MC->setPin(IN2pin, HIGH);
break;
case RELEASE:
MC->setPin(IN1pin, LOW);
MC->setPin(IN2pin, LOW);
break;
}
}
void Adafruit_DCMotor::setSpeed(uint8_t speed) {
MC->setPWM(PWMpin, speed*16);
}
/******************************************
STEPPERS
******************************************/
Adafruit_StepperMotor::Adafruit_StepperMotor(void) {
revsteps = steppernum = currentstep = 0;
}
/*
uint16_t steps, Adafruit_MotorShield controller) {
revsteps = steps;
steppernum = 1;
currentstep = 0;
if (steppernum == 1) {
latch_state &= ~_BV(MOTOR1_A) & ~_BV(MOTOR1_B) &
~_BV(MOTOR2_A) & ~_BV(MOTOR2_B); // all motor pins to 0
// enable both H bridges
pinMode(11, OUTPUT);
pinMode(3, OUTPUT);
digitalWrite(11, HIGH);
digitalWrite(3, HIGH);
// use PWM for microstepping support
MC->setPWM(1, 255);
MC->setPWM(2, 255);
} else if (steppernum == 2) {
latch_state &= ~_BV(MOTOR3_A) & ~_BV(MOTOR3_B) &
~_BV(MOTOR4_A) & ~_BV(MOTOR4_B); // all motor pins to 0
// enable both H bridges
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
// use PWM for microstepping support
// use PWM for microstepping support
MC->setPWM(3, 255);
MC->setPWM(4, 255);
}
}
*/
void Adafruit_StepperMotor::setSpeed(uint16_t rpm) {
//Serial.println("steps per rev: "); Serial.println(revsteps);
//Serial.println("RPM: "); Serial.println(rpm);
usperstep = 60000000 / ((uint32_t)revsteps * (uint32_t)rpm);
}
void Adafruit_StepperMotor::release(void) {
MC->setPin(AIN1pin, LOW);
MC->setPin(AIN2pin, LOW);
MC->setPin(BIN1pin, LOW);
MC->setPin(BIN2pin, LOW);
MC->setPWM(PWMApin, 0);
MC->setPWM(PWMBpin, 0);
}
void Adafruit_StepperMotor::step(uint16_t steps, uint8_t dir, uint8_t style) {
uint32_t uspers = usperstep;
uint8_t ret = 0;
if (style == INTERLEAVE) {
uspers /= 2;
}
else if (style == MICROSTEP) {
uspers /= MICROSTEPS;
steps *= MICROSTEPS;
#ifdef MOTORDEBUG
Serial.print("steps = "); Serial.println(steps, DEC);
#endif
}
while (steps--) {
//Serial.println("step!"); Serial.println(uspers);
ret = onestep(dir, style);
delayMicroseconds(uspers);
yield(); // required for ESP8266
}
}
uint8_t Adafruit_StepperMotor::onestep(uint8_t dir, uint8_t style) {
uint8_t a, b, c, d;
uint8_t ocrb, ocra;
ocra = ocrb = 255;
// next determine what sort of stepping procedure we're up to
if (style == SINGLE) {
if ((currentstep/(MICROSTEPS/2)) % 2) { // we're at an odd step, weird
if (dir == FORWARD) {
currentstep += MICROSTEPS/2;
}
else {
currentstep -= MICROSTEPS/2;
}
} else { // go to the next even step
if (dir == FORWARD) {
currentstep += MICROSTEPS;
}
else {
currentstep -= MICROSTEPS;
}
}
} else if (style == DOUBLE) {
if (! (currentstep/(MICROSTEPS/2) % 2)) { // we're at an even step, weird
if (dir == FORWARD) {
currentstep += MICROSTEPS/2;
} else {
currentstep -= MICROSTEPS/2;
}
} else { // go to the next odd step
if (dir == FORWARD) {
currentstep += MICROSTEPS;
} else {
currentstep -= MICROSTEPS;
}
}
} else if (style == INTERLEAVE) {
if (dir == FORWARD) {
currentstep += MICROSTEPS/2;
} else {
currentstep -= MICROSTEPS/2;
}
}
if (style == MICROSTEP) {
if (dir == FORWARD) {
currentstep++;
} else {
// BACKWARDS
currentstep--;
}
currentstep += MICROSTEPS*4;
currentstep %= MICROSTEPS*4;
ocra = ocrb = 0;
if ( (currentstep >= 0) && (currentstep < MICROSTEPS)) {
ocra = microstepcurve[MICROSTEPS - currentstep];
ocrb = microstepcurve[currentstep];
} else if ( (currentstep >= MICROSTEPS) && (currentstep < MICROSTEPS*2)) {
ocra = microstepcurve[currentstep - MICROSTEPS];
ocrb = microstepcurve[MICROSTEPS*2 - currentstep];
} else if ( (currentstep >= MICROSTEPS*2) && (currentstep < MICROSTEPS*3)) {
ocra = microstepcurve[MICROSTEPS*3 - currentstep];
ocrb = microstepcurve[currentstep - MICROSTEPS*2];
} else if ( (currentstep >= MICROSTEPS*3) && (currentstep < MICROSTEPS*4)) {
ocra = microstepcurve[currentstep - MICROSTEPS*3];
ocrb = microstepcurve[MICROSTEPS*4 - currentstep];
}
}
currentstep += MICROSTEPS*4;
currentstep %= MICROSTEPS*4;
#ifdef MOTORDEBUG
Serial.print("current step: "); Serial.println(currentstep, DEC);
Serial.print(" pwmA = "); Serial.print(ocra, DEC);
Serial.print(" pwmB = "); Serial.println(ocrb, DEC);
#endif
MC->setPWM(PWMApin, ocra*16);
MC->setPWM(PWMBpin, ocrb*16);
// release all
uint8_t latch_state = 0; // all motor pins to 0
//Serial.println(step, DEC);
if (style == MICROSTEP) {
if ((currentstep >= 0) && (currentstep < MICROSTEPS))
latch_state |= 0x03;
if ((currentstep >= MICROSTEPS) && (currentstep < MICROSTEPS*2))
latch_state |= 0x06;
if ((currentstep >= MICROSTEPS*2) && (currentstep < MICROSTEPS*3))
latch_state |= 0x0C;
if ((currentstep >= MICROSTEPS*3) && (currentstep < MICROSTEPS*4))
latch_state |= 0x09;
} else {
switch (currentstep/(MICROSTEPS/2)) {
case 0:
latch_state |= 0x1; // energize coil 1 only
break;
case 1:
latch_state |= 0x3; // energize coil 1+2
break;
case 2:
latch_state |= 0x2; // energize coil 2 only
break;
case 3:
latch_state |= 0x6; // energize coil 2+3
break;
case 4:
latch_state |= 0x4; // energize coil 3 only
break;
case 5:
latch_state |= 0xC; // energize coil 3+4
break;
case 6:
latch_state |= 0x8; // energize coil 4 only
break;
case 7:
latch_state |= 0x9; // energize coil 1+4
break;
}
}
#ifdef MOTORDEBUG
Serial.print("Latch: 0x"); Serial.println(latch_state, HEX);
#endif
if (latch_state & 0x1) {
// Serial.println(AIN2pin);
MC->setPin(AIN2pin, HIGH);
} else {
MC->setPin(AIN2pin, LOW);
}
if (latch_state & 0x2) {
MC->setPin(BIN1pin, HIGH);
// Serial.println(BIN1pin);
} else {
MC->setPin(BIN1pin, LOW);
}
if (latch_state & 0x4) {
MC->setPin(AIN1pin, HIGH);
// Serial.println(AIN1pin);
} else {
MC->setPin(AIN1pin, LOW);
}
if (latch_state & 0x8) {
MC->setPin(BIN2pin, HIGH);
// Serial.println(BIN2pin);
} else {
MC->setPin(BIN2pin, LOW);
}
return currentstep;
}

102
shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/Adafruit_MotorShield.h

@ -0,0 +1,102 @@
/******************************************************************
This is the library for the Adafruit Motor Shield V2 for Arduino.
It supports DC motors & Stepper motors with microstepping as well
as stacking-support. It is *not* compatible with the V1 library!
It will only work with https://www.adafruit.com/products/1483
Adafruit invests time and resources providing this open
source code, please support Adafruit and open-source hardware
by purchasing products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, check license.txt for more information.
All text above must be included in any redistribution.
******************************************************************/
#ifndef _Adafruit_MotorShield_h_
#define _Adafruit_MotorShield_h_
#include <inttypes.h>
#include <Wire.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"
//#define MOTORDEBUG
#define MICROSTEPS 16 // 8 or 16
#define MOTOR1_A 2
#define MOTOR1_B 3
#define MOTOR2_A 1
#define MOTOR2_B 4
#define MOTOR4_A 0
#define MOTOR4_B 6
#define MOTOR3_A 5
#define MOTOR3_B 7
#define FORWARD 1
#define BACKWARD 2
#define BRAKE 3
#define RELEASE 4
#define SINGLE 1
#define DOUBLE 2
#define INTERLEAVE 3
#define MICROSTEP 4
class Adafruit_MotorShield;
class Adafruit_DCMotor
{
public:
Adafruit_DCMotor(void);
friend class Adafruit_MotorShield;
void run(uint8_t);
void setSpeed(uint8_t);
private:
uint8_t PWMpin, IN1pin, IN2pin;
Adafruit_MotorShield *MC;
uint8_t motornum;
};
class Adafruit_StepperMotor {
public:
Adafruit_StepperMotor(void);
friend class Adafruit_MotorShield;
void step(uint16_t steps, uint8_t dir, uint8_t style = SINGLE);
void setSpeed(uint16_t);
uint8_t onestep(uint8_t dir, uint8_t style);
void release(void);
uint32_t usperstep;
private:
uint8_t PWMApin, AIN1pin, AIN2pin;
uint8_t PWMBpin, BIN1pin, BIN2pin;
uint16_t revsteps; // # steps per revolution
uint8_t currentstep;
Adafruit_MotorShield *MC;
uint8_t steppernum;
};
class Adafruit_MotorShield
{
public:
Adafruit_MotorShield(uint8_t addr = 0x60);
friend class Adafruit_DCMotor;
void begin(uint16_t freq = 1600);
void setPWM(uint8_t pin, uint16_t val);
void setPin(uint8_t pin, boolean val);
Adafruit_DCMotor *getMotor(uint8_t n);
Adafruit_StepperMotor *getStepper(uint16_t steps, uint8_t n);
private:
uint8_t _addr;
uint16_t _freq;
Adafruit_DCMotor dcmotors[4];
Adafruit_StepperMotor steppers[2];
Adafruit_MS_PWMServoDriver _pwm;
};
#endif

47
shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/README.md

@ -0,0 +1,47 @@
# Adafruit Motor Shield v2 Library
This is the library for the Adafruit Motor Shield V2 for Arduino.
It supports DC motors & Stepper motors with microstepping as well
as stacking-support. It is *not* compatible with the V1 library!
It will only work with https://www.adafruit.com/products/1438
<!-- START COMPATIBILITY TABLE -->
## Compatibility
MCU | Tested Works | Doesn't Work | Not Tested | Notes
------------------ | :----------: | :----------: | :---------: | -----
Atmega328 @ 16MHz | X | | |
Atmega328 @ 12MHz | X | | |
Atmega32u4 @ 16MHz | X | | |
Atmega32u4 @ 8MHz | X | | |
ESP8266 | | | X |
Atmega2560 @ 16MHz | X | | |
ATSAM3X8E | | X | |
ATSAM21D | | X | |
ATtiny85 @ 16MHz | | | X |
ATtiny85 @ 8MHz | | | X |
Intel Curie @ 32MHz | | | X |
STM32F2 | | | X |
* ATmega328 @ 16MHz : Arduino UNO, Adafruit Pro Trinket 5V, Adafruit Metro 328, Adafruit Metro Mini
* ATmega328 @ 12MHz : Adafruit Pro Trinket 3V
* ATmega32u4 @ 16MHz : Arduino Leonardo, Arduino Micro, Arduino Yun, Teensy 2.0
* ATmega32u4 @ 8MHz : Adafruit Flora, Bluefruit Micro
* ESP8266 : Adafruit Huzzah
* ATmega2560 @ 16MHz : Arduino Mega
* ATSAM3X8E : Arduino Due
* ATSAM21D : Arduino Zero, M0 Pro
* ATtiny85 @ 16MHz : Adafruit Trinket 5V
* ATtiny85 @ 8MHz : Adafruit Gemma, Arduino Gemma, Adafruit Trinket 3V
<!-- END COMPATIBILITY TABLE -->
Adafruit invests time and resources providing this open
source code, please support Adafruit and open-source hardware
by purchasing products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, check license.txt for more information.
All text above must be included in any redistribution.

52
shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/examples/Accel_ConstantSpeed/Accel_ConstantSpeed.ino

@ -0,0 +1,52 @@
// ConstantSpeed.pde
// -*- mode: C++ -*-
//
// Shows how to run AccelStepper in the simplest,
// fixed speed mode with no accelerations
// Requires the Adafruit_Motorshield v2 library
// https://github.com/adafruit/Adafruit_Motor_Shield_V2_Library
// And AccelStepper with AFMotor support
// https://github.com/adafruit/AccelStepper
// This tutorial is for Adafruit Motorshield v2 only!
// Will not work with v1 shields
#include <AccelStepper.h>
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"
// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
// Or, create it with a different I2C address (say for stacking)
// Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61);
// Connect a stepper motor with 200 steps per revolution (1.8 degree)
// to motor port #2 (M3 and M4)
Adafruit_StepperMotor *myStepper1 = AFMS.getStepper(200, 2);
// you can change these to DOUBLE or INTERLEAVE or MICROSTEP!
void forwardstep1() {
myStepper1->onestep(FORWARD, SINGLE);
}
void backwardstep1() {
myStepper1->onestep(BACKWARD, SINGLE);
}
AccelStepper Astepper1(forwardstep1, backwardstep1); // use functions to step
void setup()
{
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Stepper test!");
AFMS.begin(); // create with the default frequency 1.6KHz
//AFMS.begin(1000); // OR with a different frequency, say 1KHz
Astepper1.setSpeed(50);
}
void loop()
{
Astepper1.runSpeed();
}

90
shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/examples/Accel_MultiStepper/Accel_MultiStepper.ino

@ -0,0 +1,90 @@
// Shows how to run three Steppers at once with varying speeds
//
// Requires the Adafruit_Motorshield v2 library
// https://github.com/adafruit/Adafruit_Motor_Shield_V2_Library
// And AccelStepper with AFMotor support
// https://github.com/adafruit/AccelStepper
// This tutorial is for Adafruit Motorshield v2 only!
// Will not work with v1 shields
#include <AccelStepper.h>
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"
Adafruit_MotorShield AFMSbot(0x61); // Rightmost jumper closed
Adafruit_MotorShield AFMStop(0x60); // Default address, no jumpers
// Connect two steppers with 200 steps per revolution (1.8 degree)
// to the top shield
Adafruit_StepperMotor *myStepper1 = AFMStop.getStepper(200, 1);
Adafruit_StepperMotor *myStepper2 = AFMStop.getStepper(200, 2);
// Connect one stepper with 200 steps per revolution (1.8 degree)
// to the bottom shield
Adafruit_StepperMotor *myStepper3 = AFMSbot.getStepper(200, 2);
// you can change these to DOUBLE or INTERLEAVE or MICROSTEP!
// wrappers for the first motor!
void forwardstep1() {
myStepper1->onestep(FORWARD, SINGLE);
}
void backwardstep1() {
myStepper1->onestep(BACKWARD, SINGLE);
}
// wrappers for the second motor!
void forwardstep2() {
myStepper2->onestep(FORWARD, DOUBLE);
}
void backwardstep2() {
myStepper2->onestep(BACKWARD, DOUBLE);
}
// wrappers for the third motor!
void forwardstep3() {
myStepper3->onestep(FORWARD, INTERLEAVE);
}
void backwardstep3() {
myStepper3->onestep(BACKWARD, INTERLEAVE);
}
// Now we'll wrap the 3 steppers in an AccelStepper object
AccelStepper stepper1(forwardstep1, backwardstep1);
AccelStepper stepper2(forwardstep2, backwardstep2);
AccelStepper stepper3(forwardstep3, backwardstep3);
void setup()
{
AFMSbot.begin(); // Start the bottom shield
AFMStop.begin(); // Start the top shield
stepper1.setMaxSpeed(100.0);
stepper1.setAcceleration(100.0);
stepper1.moveTo(24);
stepper2.setMaxSpeed(200.0);
stepper2.setAcceleration(100.0);
stepper2.moveTo(50000);
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());
if (stepper2.distanceToGo() == 0)
stepper2.moveTo(-stepper2.currentPosition());
if (stepper3.distanceToGo() == 0)
stepper3.moveTo(-stepper3.currentPosition());
stepper1.run();
stepper2.run();
stepper3.run();
}

68
shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/examples/DCMotorTest/DCMotorTest.ino

@ -0,0 +1,68 @@
/*
This is a test sketch for the Adafruit assembled Motor Shield for Arduino v2
It won't work with v1.x motor shields! Only for the v2's with built in PWM
control
For use with the Adafruit Motor Shield v2
----> http://www.adafruit.com/products/1438
*/
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"
// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
// Or, create it with a different I2C address (say for stacking)
// Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61);
// Select which 'port' M1, M2, M3 or M4. In this case, M1
Adafruit_DCMotor *myMotor = AFMS.getMotor(1);
// You can also make another motor on port M2
//Adafruit_DCMotor *myOtherMotor = AFMS.getMotor(2);
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Adafruit Motorshield v2 - DC Motor test!");
AFMS.begin(); // create with the default frequency 1.6KHz
//AFMS.begin(1000); // OR with a different frequency, say 1KHz
// Set the speed to start, from 0 (off) to 255 (max speed)
myMotor->setSpeed(150);
myMotor->run(FORWARD);
// turn on motor
myMotor->run(RELEASE);
}
void loop() {
uint8_t i;
Serial.print("tick");
myMotor->run(FORWARD);
for (i=0; i<255; i++) {
myMotor->setSpeed(i);
delay(10);
}
for (i=255; i!=0; i--) {
myMotor->setSpeed(i);
delay(10);
}
Serial.print("tock");
myMotor->run(BACKWARD);
for (i=0; i<255; i++) {
myMotor->setSpeed(i);
delay(10);
}
for (i=255; i!=0; i--) {
myMotor->setSpeed(i);
delay(10);
}
Serial.print("tech");
myMotor->run(RELEASE);
delay(1000);
}

84
shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/examples/MotorParty/MotorParty.ino

@ -0,0 +1,84 @@
/*
This is a test sketch for the Adafruit assembled Motor Shield for Arduino v2
It won't work with v1.x motor shields! Only for the v2's with built in PWM
control
For use with the Adafruit Motor Shield v2
----> http://www.adafruit.com/products/1438
This sketch creates a fun motor party on your desk *whiirrr*
Connect a unipolar/bipolar stepper to M3/M4
Connect a DC motor to M1
Connect a hobby servo to SERVO1
*/
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"
#include <Servo.h>
// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
// Or, create it with a different I2C address (say for stacking)
// Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61);
// Connect a stepper motor with 200 steps per revolution (1.8 degree)
// to motor port #2 (M3 and M4)
Adafruit_StepperMotor *myStepper = AFMS.getStepper(200, 2);
// And connect a DC motor to port M1
Adafruit_DCMotor *myMotor = AFMS.getMotor(1);
// We'll also test out the built in Arduino Servo library
Servo servo1;
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("MMMMotor party!");
AFMS.begin(); // create with the default frequency 1.6KHz
//AFMS.begin(1000); // OR with a different frequency, say 1KHz
// Attach a servo to pin #10
servo1.attach(10);
// turn on motor M1
myMotor->setSpeed(200);
myMotor->run(RELEASE);
// setup the stepper
myStepper->setSpeed(10); // 10 rpm
}
int i;
void loop() {
myMotor->run(FORWARD);
for (i=0; i<255; i++) {
servo1.write(map(i, 0, 255, 0, 180));
myMotor->setSpeed(i);
myStepper->step(1, FORWARD, INTERLEAVE);
delay(3);
}
for (i=255; i!=0; i--) {
servo1.write(map(i, 0, 255, 0, 180));
myMotor->setSpeed(i);
myStepper->step(1, BACKWARD, INTERLEAVE);
delay(3);
}
myMotor->run(BACKWARD);
for (i=0; i<255; i++) {
servo1.write(map(i, 0, 255, 0, 180));
myMotor->setSpeed(i);
myStepper->step(1, FORWARD, DOUBLE);
delay(3);
}
for (i=255; i!=0; i--) {
servo1.write(map(i, 0, 255, 0, 180));
myMotor->setSpeed(i);
myStepper->step(1, BACKWARD, DOUBLE);
delay(3);
}
}

76
shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/examples/StackingTest/StackingTest.ino

@ -0,0 +1,76 @@
/*
This is a test sketch for the Adafruit assembled Motor Shield for Arduino v2
It won't work with v1.x motor shields! Only for the v2's with built in PWM
control
For use with the Adafruit Motor Shield v2
----> http://www.adafruit.com/products/1438
*/
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"
Adafruit_MotorShield AFMSbot(0x61); // Rightmost jumper closed
Adafruit_MotorShield AFMStop(0x60); // Default address, no jumpers
// On the top shield, connect two steppers, each with 200 steps
Adafruit_StepperMotor *myStepper2 = AFMStop.getStepper(200, 1);
Adafruit_StepperMotor *myStepper3 = AFMStop.getStepper(200, 2);
// On the bottom shield connect a stepper to port M3/M4 with 200 steps
Adafruit_StepperMotor *myStepper1 = AFMSbot.getStepper(200, 2);
// And a DC Motor to port M1
Adafruit_DCMotor *myMotor1 = AFMSbot.getMotor(1);
void setup() {
while (!Serial);
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("MMMMotor party!");
AFMSbot.begin(); // Start the bottom shield
AFMStop.begin(); // Start the top shield
// turn on the DC motor
myMotor1->setSpeed(200);
myMotor1->run(RELEASE);
}
int i;
void loop() {
myMotor1->run(FORWARD);
for (i=0; i<255; i++) {
myMotor1->setSpeed(i);
myStepper1->onestep(FORWARD, INTERLEAVE);
myStepper2->onestep(BACKWARD, DOUBLE);
myStepper3->onestep(FORWARD, MICROSTEP);
delay(3);
}
for (i=255; i!=0; i--) {
myMotor1->setSpeed(i);
myStepper1->onestep(BACKWARD, INTERLEAVE);
myStepper2->onestep(FORWARD, DOUBLE);
myStepper3->onestep(BACKWARD, MICROSTEP);
delay(3);
}
myMotor1->run(BACKWARD);
for (i=0; i<255; i++) {
myMotor1->setSpeed(i);
myStepper1->onestep(FORWARD, DOUBLE);
myStepper2->onestep(BACKWARD, INTERLEAVE);
myStepper3->onestep(FORWARD, MICROSTEP);
delay(3);
}
for (i=255; i!=0; i--) {
myMotor1->setSpeed(i);
myStepper1->onestep(BACKWARD, DOUBLE);
myStepper2->onestep(FORWARD, INTERLEAVE);
myStepper3->onestep(BACKWARD, MICROSTEP);
delay(3);
}
}

51
shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/examples/StepperTest/StepperTest.ino

@ -0,0 +1,51 @@
/*
This is a test sketch for the Adafruit assembled Motor Shield for Arduino v2
It won't work with v1.x motor shields! Only for the v2's with built in PWM
control
For use with the Adafruit Motor Shield v2
----> http://www.adafruit.com/products/1438
*/
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"
// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
// Or, create it with a different I2C address (say for stacking)
// Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61);
// Connect a stepper motor with 200 steps per revolution (1.8 degree)
// to motor port #2 (M3 and M4)
Adafruit_StepperMotor *myMotor = AFMS.getStepper(200, 2);
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Stepper test!");
AFMS.begin(); // create with the default frequency 1.6KHz
//AFMS.begin(1000); // OR with a different frequency, say 1KHz
myMotor->setSpeed(10); // 10 rpm
}
void loop() {
Serial.println("Single coil steps");
myMotor->step(100, FORWARD, SINGLE);
myMotor->step(100, BACKWARD, SINGLE);
Serial.println("Double coil steps");
myMotor->step(100, FORWARD, DOUBLE);
myMotor->step(100, BACKWARD, DOUBLE);
Serial.println("Interleave coil steps");
myMotor->step(100, FORWARD, INTERLEAVE);
myMotor->step(100, BACKWARD, INTERLEAVE);
Serial.println("Microstep steps");
myMotor->step(50, FORWARD, MICROSTEP);
myMotor->step(50, BACKWARD, MICROSTEP);
}

40
shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/keywords.txt

@ -0,0 +1,40 @@
#######################################
# Syntax Coloring Map for AFMotor
#######################################
#######################################
# Datatypes (KEYWORD1)
#######################################
Adafruit_MotorShield KEYWORD1
Adafruit_DCMotor KEYWORD1
Adafruit_StepperMotor KEYWORD1
#######################################
# Methods and Functions (KEYWORD2)
#######################################
enable KEYWORD2
run KEYWORD2
setSpeed KEYWORD2
step KEYWORD2
onestep KEYWORD2
release KEYWORD2
getMotor KEYWORD2
getStepper KEYWORD2
setPin KEYWORD2
setPWM KEYWORD2
#######################################
# Constants (LITERAL1)
#######################################
MICROSTEPPING LITERAL1
FORWARD LITERAL1
BACKWARD LITERAL1
BRAKE LITERAL1
RELEASE LITERAL1
SINGLE LITERAL1
DOUBLE LITERAL1
INTERLEAVE LITERAL1
MICROSTEP LITERAL1

9
shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/library.properties

@ -0,0 +1,9 @@
name=Adafruit Motor Shield V2 Library
version=1.0.4
author=Adafruit
maintainer=Adafruit <info@adafruit.com>
sentence=Library for the Adafruit Motor Shield V2 for Arduino. It supports DC motors & stepper motors with microstepping as well as stacking-support.
paragraph=Library for the Adafruit Motor Shield V2 for Arduino. It supports DC motors & stepper motors with microstepping as well as stacking-support.
category=Device Control
url=https://github.com/adafruit/Adafruit_Motor_Shield_V2_Library
architectures=*

25
shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/license.txt

@ -0,0 +1,25 @@
Software License Agreement (BSD License)
Copyright (c) 2012, Adafruit Industries. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

113
shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/utility/Adafruit_MS_PWMServoDriver.cpp

@ -0,0 +1,113 @@
/***************************************************
This is a library for our Adafruit 16-channel PWM & Servo driver
Pick one up today in the adafruit shop!
------> http://www.adafruit.com/products/815
These displays use I2C to communicate, 2 pins are required to
interface. For Arduino UNOs, thats SCL -> Analog 5, SDA -> Analog 4
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/
#include <Adafruit_MS_PWMServoDriver.h>
#include <Wire.h>
#if defined(ARDUINO_SAM_DUE)
#define WIRE Wire1
#else
#define WIRE Wire
#endif
Adafruit_MS_PWMServoDriver::Adafruit_MS_PWMServoDriver(uint8_t addr) {
_i2caddr = addr;
}
void Adafruit_MS_PWMServoDriver::begin(void) {
WIRE.begin();
reset();
}
void Adafruit_MS_PWMServoDriver::reset(void) {
write8(PCA9685_MODE1, 0x0);
}
void Adafruit_MS_PWMServoDriver::setPWMFreq(float freq) {
//Serial.print("Attempting to set freq ");
//Serial.println(freq);
freq *= 0.9; // Correct for overshoot in the frequency setting (see issue #11).
float prescaleval = 25000000;
prescaleval /= 4096;
prescaleval /= freq;
prescaleval -= 1;
//Serial.print("Estimated pre-scale: "); Serial.println(prescaleval);
uint8_t prescale = floor(prescaleval + 0.5);
//Serial.print("Final pre-scale: "); Serial.println(prescale);
uint8_t oldmode = read8(PCA9685_MODE1);
uint8_t newmode = (oldmode&0x7F) | 0x10; // sleep
write8(PCA9685_MODE1, newmode); // go to sleep
write8(PCA9685_PRESCALE, prescale); // set the prescaler
write8(PCA9685_MODE1, oldmode);
delay(5);
write8(PCA9685_MODE1, oldmode | 0xa1); // This sets the MODE1 register to turn on auto increment.
// This is why the beginTransmission below was not working.
// Serial.print("Mode now 0x"); Serial.println(read8(PCA9685_MODE1), HEX);
}
void Adafruit_MS_PWMServoDriver::setPWM(uint8_t num, uint16_t on, uint16_t off) {
//Serial.print("Setting PWM "); Serial.print(num); Serial.print(": "); Serial.print(on); Serial.print("->"); Serial.println(off);
WIRE.beginTransmission(_i2caddr);
#if ARDUINO >= 100
WIRE.write(LED0_ON_L+4*num);
WIRE.write(on);
WIRE.write(on>>8);
WIRE.write(off);
WIRE.write(off>>8);
#else
WIRE.send(LED0_ON_L+4*num);
WIRE.send((uint8_t)on);
WIRE.send((uint8_t)(on>>8));
WIRE.send((uint8_t)off);
WIRE.send((uint8_t)(off>>8));
#endif
WIRE.endTransmission();
}
uint8_t Adafruit_MS_PWMServoDriver::read8(uint8_t addr) {
WIRE.beginTransmission(_i2caddr);
#if ARDUINO >= 100
WIRE.write(addr);
#else
WIRE.send(addr);
#endif
WIRE.endTransmission();
WIRE.requestFrom((uint8_t)_i2caddr, (uint8_t)1);
#if ARDUINO >= 100
return WIRE.read();
#else
return WIRE.receive();
#endif
}
void Adafruit_MS_PWMServoDriver::write8(uint8_t addr, uint8_t d) {
WIRE.beginTransmission(_i2caddr);
#if ARDUINO >= 100
WIRE.write(addr);
WIRE.write(d);
#else
WIRE.send(addr);
WIRE.send(d);
#endif
WIRE.endTransmission();
}

61
shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/utility/Adafruit_MS_PWMServoDriver.h

@ -0,0 +1,61 @@
/***************************************************
This is a library for our Adafruit 16-channel PWM & Servo driver
Pick one up today in the adafruit shop!
------> http://www.adafruit.com/products/815
These displays use I2C to communicate, 2 pins are required to
interface. For Arduino UNOs, thats SCL -> Analog 5, SDA -> Analog 4
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/
#ifndef _Adafruit_MS_PWMServoDriver_H
#define _Adafruit_MS_PWMServoDriver_H
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#define PCA9685_SUBADR1 0x2
#define PCA9685_SUBADR2 0x3
#define PCA9685_SUBADR3 0x4
#define PCA9685_MODE1 0x0
#define PCA9685_PRESCALE 0xFE
#define LED0_ON_L 0x6
#define LED0_ON_H 0x7
#define LED0_OFF_L 0x8
#define LED0_OFF_H 0x9
#define ALLLED_ON_L 0xFA
#define ALLLED_ON_H 0xFB
#define ALLLED_OFF_L 0xFC
#define ALLLED_OFF_H 0xFD
class Adafruit_MS_PWMServoDriver {
public:
Adafruit_MS_PWMServoDriver(uint8_t addr = 0x40);
void begin(void);
void reset(void);
void setPWMFreq(float freq);
void setPWM(uint8_t num, uint16_t on, uint16_t off);
private:
uint8_t _i2caddr;
uint8_t read8(uint8_t addr);
void write8(uint8_t addr, uint8_t d);
};
#endif

26
shields/Adafruit Motor Shield v2.3/Adafruit Motor Shield V2 Library/utility/license.txt

@ -0,0 +1,26 @@
Software License Agreement (BSD License)
Copyright (c) 2012, Adafruit Industries
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

BIN
shields/Adafruit Motor Shield v2.3/Data Sheet Motor Driver TB6612FNG.pdf

Binary file not shown.

BIN
shields/Adafruit Motor Shield v2.3/Motor Shield Schematics.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

13
shields/Adafruit Motor Shield v2.3/readme.md

@ -0,0 +1,13 @@
Adafruit Motor Shield V2
========================
Detailed information on the Adafruit Motor Shield V2 can be found on the [product website](https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino).
Content:
- Adafruit Motor Shield V2 Library
software library for the Shield
- AccelStepper Library
additional software for controlling stepper motors
- Motor Shield Schematics.png
- Data Sheet Motor Driver TB6612FNG.pdf

BIN
shields/Data Logger Shield mSD/mSD-Shield_v20.pdf

Binary file not shown.

28
shields/Data Logger Shield mSD/mSD_Shield Library/README.md

@ -0,0 +1,28 @@
# mSD-Shield
## Schematics
The schematics can be found [here](https://github.com/watterott/mSD-Shield#msd-shield).
## Examples
Examples can be found in the Arduino IDE under ```File -> Examples -> mSD_Shield``` and ```File -> Examples -> SD```.
## mSD-Shield + Ethernet-Shield
If using the Ethernet-Shield together with the mSD-Shield, this must be initialized before using the SD-Card. Because otherwise the W5100 Ethernet controller blocks the SPI interface.
## mSD-Shield v2
The mSD-Shield v2 uses the ICSP connector for the SPI signals and so all Arduino boards can be used.
## mSD-Shield v1 (not mSD-Shield Mega-Edition)
For Hardware-SPI support on Mega boards connect the mSD-Shield v1 as follows.
No Software changes are required.
Mega mSD-Shield v1
SCK 52 -> 13
MOSI 51 -> 11
MISO 50 -> 12
For using the RTC on Mega boards the I2C pins have to be changed.
Mega mSD-Shield v1
SDA 20 -> A4
SCL 21 -> A5

113
shields/Data Logger Shield mSD/mSD_Shield Library/examples/BMPDemo/BMPDemo.ino

@ -0,0 +1,113 @@
/*
BMP-File Demonstration
*/
#include <Wire.h>
#include <SPI.h>
#include <digitalWriteFast.h>
#include <GraphicsLib.h>
#include <MI0283QT2.h>
#include <MI0283QT9.h>
#include <DisplaySPI.h>
#include <DisplayI2C.h>
#include <SD.h>
#include <BMPheader.h>
//Declare only one display !
// MI0283QT2 lcd; //MI0283QT2 Adapter v1
// MI0283QT9 lcd; //MI0283QT9 Adapter v1
// DisplaySPI lcd; //SPI (GLCD-Shield or MI0283QT Adapter v2)
DisplayI2C lcd; //I2C (GLCD-Shield or MI0283QT Adapter v2)
uint8_t OpenBMPFile(char *file, int16_t x, int16_t y)
{
File myFile;
uint8_t buf[40]; //read buf (min. size = sizeof(BMP_DIPHeader))
BMP_Header *bmp_hd;
BMP_DIPHeader *bmp_dip;
int16_t width, height, w, h;
uint8_t pad, result=0;
//open file
myFile = SD.open(file);
if(myFile)
{
result = 1;
//BMP Header
myFile.read(&buf, sizeof(BMP_Header));
bmp_hd = (BMP_Header*)&buf[0];
if((bmp_hd->magic[0] == 'B') && (bmp_hd->magic[1] == 'M') && (bmp_hd->offset == 54))
{
result = 2;
//BMP DIP-Header
myFile.read(&buf, sizeof(BMP_DIPHeader));
bmp_dip = (BMP_DIPHeader*)&buf[0];
if((bmp_dip->size == sizeof(BMP_DIPHeader)) && (bmp_dip->bitspp == 24) && (bmp_dip->compress == 0))
{
result = 3;
//BMP Data (1. pixel = bottom left)
width = bmp_dip->width;
height = bmp_dip->height;
pad = width % 4; //padding (line is multiply of 4)
if((x+width) <= lcd.getWidth() && (y+height) <= lcd.getHeight())
{
result = 4;
lcd.setArea(x, y, x+width-1, y+height-1);
for(h=(y+height-1); h >= y; h--) //for every line
{
for(w=x; w < (x+width); w++) //for every pixel in line
{
myFile.read(&buf, 3);
lcd.drawPixel(w, h, RGB(buf[2],buf[1],buf[0]));
}
if(pad)
{
myFile.read(&buf, pad);
}
}
}
else
{
lcd.drawText(x, y, "Pic out of screen!", RGB(0,0,0), RGB(255,255,255), 1);
}
}
}
myFile.close();
}
return result;
}
void setup()
{
int x, i;
//init Display
lcd.begin();
//lcd.begin(SPI_CLOCK_DIV4, 8); //SPI Displays: spi-clk=Fcpu/4, rst-pin=8
//lcd.begin(0x20, 8); //I2C Displays: addr=0x20, rst-pin=8
lcd.fillScreen(RGB(255,255,255));
//init SD-Card
x = lcd.drawText(5, 5, "Init SD-Card...", RGB(0,0,0), RGB(255,255,255), 1);
if(!SD.begin(4)) //cs-pin=4
{
lcd.drawText(x, 5, "failed", RGB(0,0,0), RGB(255,255,255), 1);
while(1);
}
//open windows bmp file (24bit RGB)
x = lcd.drawText(5, 5, "Open File...", RGB(0,0,0), RGB(255,255,255), 1);
i = OpenBMPFile("image.bmp", 20, 20);
lcd.drawInteger(x, 5, i, 10, RGB(0,0,0), RGB(255,255,255), 1);
}
void loop()
{
//do nothing
}

BIN
shields/Data Logger Shield mSD/mSD_Shield Library/examples/BMPDemo/image.bmp

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

93
shields/Data Logger Shield mSD/mSD_Shield Library/examples/DataLogger/DataLogger.ino

@ -0,0 +1,93 @@
/*
Data Logger Example
*/
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <DS1307.h>
DS1307 rtc;
void setup()
{
int x;
//init Serial port
Serial.begin(9600);
while(!Serial); //wait for serial port to connect - needed for Leonardo only
//init RTC
Serial.print("Init RTC...");
//only set the date+time one time
// rtc.set(0, 0, 8, 24, 12, 2014); //08:00:00 24.12.2014 //sec, min, hour, day, month, year
rtc.start();
Serial.println("ok");
//init SD-Card
Serial.print("Init SD-Card...");
if(!SD.begin(4)) //cs-pin=4
{
Serial.println("failed");
while(1);
}
else
{
Serial.println("ok");
}
Serial.println("Start logging...");
}
void loop()
{
String dataString = ""; //string for logging data
int sec, min, hour, day, month, year;
//get time from RTC
rtc.get(&sec, &min, &hour, &day, &month, &year);
dataString += String(hour);
dataString += ":";
dataString += String(min);
dataString += ":";
dataString += String(sec);
dataString += ";";
dataString += String(year);
dataString += "-";
dataString += String(month);
dataString += "-";
dataString += String(day);
dataString += ";";
//read analog input 0,1,2
for(int analogPin=0; analogPin < 3; analogPin++)
{
int sensor = analogRead(analogPin);
dataString += String(sensor);
if(analogPin < 2)
{
dataString += ",";
}
}
//print data to the serial port
Serial.println(dataString);
//open data file from SD card
File dataFile = SD.open("datalog.txt", FILE_WRITE);
if(dataFile) //file opened successfully
{
dataFile.println(dataString);
dataFile.close();
}
else
{
Serial.println("Error opening datalog.txt");
}
//wait 1 second
delay(1000);
}

79
shields/Data Logger Shield mSD/mSD_Shield Library/examples/RTC/RTC.ino

@ -0,0 +1,79 @@
/*
RTC (Real-Time-Clock) Example
*/
#include <Wire.h>
#include <SPI.h>
#include <digitalWriteFast.h>
#include <GraphicsLib.h>
#include <MI0283QT2.h>
#include <MI0283QT9.h>
#include <DisplaySPI.h>
#include <DisplayI2C.h>
#include <DS1307.h>
//Declare only one display !
// MI0283QT2 lcd; //MI0283QT2 Adapter v1
// MI0283QT9 lcd; //MI0283QT9 Adapter v1
// DisplaySPI lcd; //SPI (GLCD-Shield or MI0283QT Adapter v2)
DisplayI2C lcd; //I2C (GLCD-Shield or MI0283QT Adapter v2)
DS1307 rtc;
void setup()
{
//init Serial port
Serial.begin(9600);
while(!Serial); //wait for serial port to connect - needed for Leonardo only
//init Display
Serial.println("Init Display...");
lcd.begin();
//lcd.begin(SPI_CLOCK_DIV4, 8); //SPI Displays: spi-clk=Fcpu/4, rst-pin=8
//lcd.begin(0x20, 8); //I2C Displays: addr=0x20, rst-pin=8
lcd.fillScreen(RGB(255,255,255));
//init RTC
Serial.println("Init RTC...");
//only set the date+time one time
// rtc.set(0, 0, 8, 24, 12, 2014); //08:00:00 24.12.2014 //sec, min, hour, day, month, year
rtc.start();
}
void loop()
{
uint8_t sec, min, hour, day, month;
uint16_t year;
char buf[16];
//get time from RTC
rtc.get(&sec, &min, &hour, &day, &month, &year);
//serial output
Serial.print("\nTime: ");
Serial.print(hour, DEC);
Serial.print(":");
Serial.print(min, DEC);
Serial.print(":");
Serial.print(sec, DEC);
Serial.print("\nDate: ");
Serial.print(day, DEC);
Serial.print(".");
Serial.print(month, DEC);
Serial.print(".");
Serial.print(year, DEC);
//display output
sprintf(buf, "%02i : %02i : %02i", hour, min, sec);
lcd.drawText(10, 5, buf, RGB(0,0,0), RGB(255,255,255), 1);
sprintf(buf, "%02i . %02i . %04i", day, month, year);
lcd.drawText(10, 20, buf, RGB(0,0,0), RGB(255,255,255), 1);
//wait a second
delay(1000);
}

96
shields/Data Logger Shield mSD/mSD_Shield Library/examples/ReadWrite/ReadWrite.ino

@ -0,0 +1,96 @@
/*
Read/Write File Example
*/
#include <Wire.h>
#include <SPI.h>
#include <digitalWriteFast.h>
#include <GraphicsLib.h>
#include <MI0283QT2.h>
#include <MI0283QT9.h>
#include <DisplaySPI.h>
#include <DisplayI2C.h>
#include <SD.h>
//Declare only one display !
// MI0283QT2 lcd; //MI0283QT2 Adapter v1
// MI0283QT9 lcd; //MI0283QT9 Adapter v1
// DisplaySPI lcd; //SPI (GLCD-Shield or MI0283QT Adapter v2)
DisplayI2C lcd; //I2C (GLCD-Shield or MI0283QT Adapter v2)
File myFile;
void setup()
{
int x;
//init Serial port
Serial.begin(9600);
while(!Serial); //wait for serial port to connect - needed for Leonardo only
//init LCD
Serial.println("Init Display...");
lcd.begin();
//lcd.begin(SPI_CLOCK_DIV4, 8); //SPI Displays: spi-clk=Fcpu/4, rst-pin=8
//lcd.begin(0x20, 8); //I2C Displays: addr=0x20, rst-pin=8
lcd.fillScreen(RGB(255,255,255));
//init SD-Card
Serial.println("Init SD-Card...");
x = lcd.drawText(5, 5, "Init SD-Card...", RGB(0,0,0), RGB(255,255,255), 1);
if(!SD.begin(4)) //cs-pin=4
{
Serial.println("failed");
lcd.drawText(x, 5, "failed", RGB(0,0,0), RGB(255,255,255), 1);
while(1);
}
//open file for writing
Serial.println("Open File...");
x = lcd.drawText(5, 5, "Open File...", RGB(0,0,0), RGB(255,255,255), 1);
myFile = SD.open("test.txt", FILE_WRITE);
if(myFile)
{
Serial.println("Writing...");
lcd.drawText(5, 5, "Writing...", RGB(0,0,0), RGB(255,255,255), 1);
myFile.println("This is a Test: ABC 123");
myFile.close();
}
else
{
Serial.println("error");
lcd.drawText(x, 5, "error", RGB(0,0,0), RGB(255,255,255), 1);
}
//open file for reading
Serial.println("Open File...");
x = lcd.drawText(5, 5, "Open File...", RGB(0,0,0), RGB(255,255,255), 1);
myFile = SD.open("test.txt");
if(myFile)
{
Serial.println("Reading...");
lcd.drawText(x, 5, "Reading...", RGB(0,0,0), RGB(255,255,255), 1);
lcd.setCursor(0, 20);
while(myFile.available())
{
uint8_t c;
c = myFile.read();
Serial.write(c);
lcd.print((char)c);
}
myFile.close();
}
else
{
Serial.println("error");
lcd.drawText(x, 5, "error", RGB(0,0,0), RGB(255,255,255), 1);
}
}
void loop()
{
//do nothing
}

13
shields/Data Logger Shield mSD/mSD_Shield Library/library.json

@ -0,0 +1,13 @@
{
"name": "mSD_Shield",
"keywords": "microsd, rtc, display, logging",
"description": "mSD-Shield (Display, microSD, RTC)",
"include": "mSD_Shield",
"repository":
{
"type": "git",
"url": "https://github.com/watterott/Arduino-Libs.git"
},
"frameworks": "arduino",
"platforms": "atmelavr"
}

9
shields/Data Logger Shield mSD/mSD_Shield Library/library.properties

@ -0,0 +1,9 @@
name=mSD_Shield
version=1.0.0
author=Watterott
maintainer=Watterott
sentence=mSD-Shield (Display, microSD, RTC)
paragraph=mSD-Shield (Display, microSD, RTC)
category=Communication
url=https://github.com/watterott/Arduino-Libs
architectures=*

1
shields/Data Logger Shield mSD/mSD_Shield Library/mSD_Shield.h

@ -0,0 +1 @@
//empty file, workaround for libraries containing only examples

230
shields/Real Time Clock RV 8523 Breakout/RV8523 Library/RV8523.cpp

@ -0,0 +1,230 @@
/*
RV8523 RTC Lib for Arduino
by Watterott electronic (www.watterott.com)
*/
#include <inttypes.h>
#if defined(__AVR__)
# include <avr/io.h>
#endif
#if ARDUINO >= 100
# include "Arduino.h"
#else
# include "WProgram.h"
#endif
#include "Wire.h"
#include "RV8523.h"
#define I2C_ADDR (0xD0>>1)
//-------------------- Constructor --------------------
RV8523::RV8523(void)
{
Wire.begin();
return;
}
//-------------------- Public --------------------
void RV8523::start(void)
{
uint8_t val;
Wire.beginTransmission(I2C_ADDR);
Wire.write(byte(0x00)); //control 1
Wire.endTransmission();
Wire.requestFrom(I2C_ADDR, 1);
val = Wire.read();
if(val & (1<<5))
{
Wire.beginTransmission(I2C_ADDR);
Wire.write(byte(0x00)); //control 1
Wire.write(val & ~(1<<5)); //clear STOP (bit 5)
Wire.endTransmission();
}
return;
}
void RV8523::stop(void)
{
uint8_t val;
Wire.beginTransmission(I2C_ADDR);
Wire.write(byte(0x00)); //control 1
Wire.endTransmission();
Wire.requestFrom(I2C_ADDR, 1);
val = Wire.read();
if(!(val & (1<<5)))
{
Wire.beginTransmission(I2C_ADDR);
Wire.write(byte(0x00)); //control 1
Wire.write(val | (1<<5)); //set STOP (bit 5)
Wire.endTransmission();
}
return;
}
void RV8523::set12HourMode(void) //set 12 hour mode
{
uint8_t val;
Wire.beginTransmission(I2C_ADDR);
Wire.write(byte(0x00)); //control 1
Wire.endTransmission();
Wire.requestFrom(I2C_ADDR, 1);
val = Wire.read();
if(!(val & (1<<3)))
{
Wire.beginTransmission(I2C_ADDR);
Wire.write(byte(0x00)); //control 1
Wire.write(val | (1<<3)); //set 12 hour mode (bit 3)
Wire.endTransmission();
}
return;
}
void RV8523::set24HourMode(void) //set 24 hour mode
{
uint8_t val;
Wire.beginTransmission(I2C_ADDR);
Wire.write(byte(0x00)); //control 1
Wire.endTransmission();
Wire.requestFrom(I2C_ADDR, 1);
val = Wire.read();
if(val & (1<<3))
{
Wire.beginTransmission(I2C_ADDR);
Wire.write(byte(0x00)); //control 1
Wire.write(val & ~(1<<3)); //set 12 hour mode (bit 3)
Wire.endTransmission();
}
return;
}
void RV8523::batterySwitchOver(int on) //activate/deactivate battery switch over mode
{
uint8_t val;
Wire.beginTransmission(I2C_ADDR);
Wire.write(byte(0x02)); //control 3
Wire.endTransmission();
Wire.requestFrom(I2C_ADDR, 1);
val = Wire.read();
if(val & 0xE0)
{
Wire.beginTransmission(I2C_ADDR);
Wire.write(byte(0x02)); //control 3
if(on)
{
Wire.write(val & ~0xE0); //battery switchover in standard mode
}
else
{
Wire.write(val | 0xE0); //battery switchover disabled
}
Wire.endTransmission();
}
return;
}
void RV8523::get(uint8_t *sec, uint8_t *min, uint8_t *hour, uint8_t *day, uint8_t *month, uint16_t *year)
{
Wire.beginTransmission(I2C_ADDR);
Wire.write(byte(0x03));
Wire.endTransmission();
Wire.requestFrom(I2C_ADDR, 7);
*sec = bcd2bin(Wire.read() & 0x7F);
*min = bcd2bin(Wire.read() & 0x7F);
*hour = bcd2bin(Wire.read() & 0x3F); //24 hour mode
*day = bcd2bin(Wire.read() & 0x3F);
bcd2bin(Wire.read() & 0x07); //day of week
*month = bcd2bin(Wire.read() & 0x1F);
*year = bcd2bin(Wire.read()) + 2000;
return;
}
void RV8523::get(int *sec, int *min, int *hour, int *day, int *month, int *year)
{
Wire.beginTransmission(I2C_ADDR);
Wire.write(byte(0x03));
Wire.endTransmission();
Wire.requestFrom(I2C_ADDR, 7);
*sec = bcd2bin(Wire.read() & 0x7F);
*min = bcd2bin(Wire.read() & 0x7F);
*hour = bcd2bin(Wire.read() & 0x3F); //24 hour mode
*day = bcd2bin(Wire.read() & 0x3F);
bcd2bin(Wire.read() & 0x07); //day of week
*month = bcd2bin(Wire.read() & 0x1F);
*year = bcd2bin(Wire.read()) + 2000;
return;
}
void RV8523::set(uint8_t sec, uint8_t min, uint8_t hour, uint8_t day, uint8_t month, uint16_t year)
{
if(year > 2000)
{
year -= 2000;
}
Wire.beginTransmission(I2C_ADDR);
Wire.write(byte(0x03));
Wire.write(bin2bcd(sec));
Wire.write(bin2bcd(min));
Wire.write(bin2bcd(hour));
Wire.write(bin2bcd(day));
Wire.write(bin2bcd(0));
Wire.write(bin2bcd(month));
Wire.write(bin2bcd(year));
Wire.endTransmission();
return;
}
void RV8523::set(int sec, int min, int hour, int day, int month, int year)
{
return set((uint8_t)sec, (uint8_t)min, (uint8_t)hour, (uint8_t)day, (uint8_t)month, (uint16_t)year);
}
//-------------------- Private --------------------
uint8_t RV8523::bin2bcd(uint8_t val)
{
return val + 6 * (val / 10);
}
uint8_t RV8523::bcd2bin(uint8_t val)
{
return val - 6 * (val >> 4);
}

29
shields/Real Time Clock RV 8523 Breakout/RV8523 Library/RV8523.h

@ -0,0 +1,29 @@
#ifndef RV8523_h
#define RV8523_h
#include <inttypes.h>
class RV8523
{
public:
RV8523();
void start(void);
void stop(void);
void get(uint8_t *sec, uint8_t *min, uint8_t *hour, uint8_t *day, uint8_t *month, uint16_t *year);
void get(int *sec, int *min, int *hour, int *day, int *month, int *year);
void set(uint8_t sec, uint8_t min, uint8_t hour, uint8_t day, uint8_t month, uint16_t year);
void set(int sec, int min, int hour, int day, int month, int year);
void set12HourMode(void);
void set24HourMode(void);
void batterySwitchOver(int on);
private:
uint8_t bin2bcd(uint8_t val);
uint8_t bcd2bin(uint8_t val);
};
#endif //RV8523_h

75
shields/Real Time Clock RV 8523 Breakout/RV8523 Library/examples/Example/Example.ino

@ -0,0 +1,75 @@
/*
RV8523 RTC (Real-Time-Clock) Example
Uno A4 (SDA), A5 (SCL)
Mega 20 (SDA), 21 (SCL)
Leonardo 2 (SDA), 3 (SCL)
Note: To enable the I2C pull-up resistors on the RTC-Breakout, the jumper J1 has to be closed.
*/
#include <Wire.h>
#include <RV8523.h>
RV8523 rtc;
void setup()
{
//init Serial port
Serial.begin(9600);
while(!Serial); //wait for serial port to connect - needed for Leonardo only
//init RTC
Serial.println("Init RTC...");
//set 12 hour mode
// rtc.set12HourMode();
//set 24 hour mode
// rtc.set24HourMode();
//set the date+time (only one time)
// rtc.set(0, 0, 8, 24, 12, 2014); //08:00:00 24.12.2014 //sec, min, hour, day, month, year
//stop/pause RTC
// rtc.stop();
//start RTC
rtc.start();
//When the power source is removed, the RTC will keep the time.
rtc.batterySwitchOver(1); //battery switch over on
//When the power source is removed, the RTC will not keep the time.
// rtc.batterySwitchOver(0); //battery switch over off
}
void loop()
{
uint8_t sec, min, hour, day, month;
uint16_t year;
//get time from RTC
rtc.get(&sec, &min, &hour, &day, &month, &year);
//serial output
Serial.print("\nTime: ");
Serial.print(hour, DEC);
Serial.print(":");
Serial.print(min, DEC);
Serial.print(":");
Serial.print(sec, DEC);
Serial.print("\nDate: ");
Serial.print(day, DEC);
Serial.print(".");
Serial.print(month, DEC);
Serial.print(".");
Serial.print(year, DEC);
//wait a second
delay(1000);
}

150
shields/Real Time Clock RV 8523 Breakout/RV8523 Library/examples/SetClock/SetClock.ino

@ -0,0 +1,150 @@
/*
RV8523 RTC (Real-Time-Clock) Set Clock Example
Uno A4 (SDA), A5 (SCL)
Mega 20 (SDA), 21 (SCL)
Leonardo 2 (SDA), 3 (SCL)
Note: To enable the I2C pull-up resistors on the RTC-Breakout, the jumper J1 has to be closed.
This sketch allows to set the time using the serial console. On linux use a command like:
stty -F /dev/ttyUSB1 speed 9600
date '+T%H%M%S%d%m%Y' > /dev/ttyUSB1
to read the current local time from the serial console. Or just type a string like
T23595924122015
to set the clock to 23:59:59 24th of December 2015 using Arduinos/Genuinos serial monitor.
Type an arbitary string not beginning with 'T' to show the current time.
*/
#include <Wire.h>
#include <RV8523.h>
#define BUFF_MAX 32
RV8523 rtc;
unsigned int recv_size = 0;
char recv[BUFF_MAX];
void setup()
{
//init Serial port
Serial.begin(9600);
while(!Serial); //wait for serial port to connect - needed for Leonardo only
//init RTC
Serial.println("Init RTC...");
//set 24 hour mode
rtc.set24HourMode();
//start RTC
rtc.start();
//When the power source is removed, the RTC will keep the time.
rtc.batterySwitchOver(1); //battery switch over on
}
void loop()
{
if (Serial.available() > 0) {
setClock();
}
}
void setClock()
{
char in;
in = Serial.read();
Serial.print(in);
if((in == 10 || in == 13) && (recv_size > 0))
{
parseCmd(recv, recv_size);
printTime();
recv_size = 0;
recv[0] = 0;
return;
}
else if (in < 48 || in > 122) //ignore ~[0-9A-Za-z]
{
//do nothing
}
else if (recv_size > BUFF_MAX - 2) //drop lines that are too long
{
recv_size = 0;
recv[0] = 0;
}
else if (recv_size < BUFF_MAX - 2)
{
recv[recv_size] = in;
recv[recv_size + 1] = 0;
recv_size += 1;
}
}
// Parse the time string and set the clock accordingly
void parseCmd(char *cmd, int cmdsize)
{
uint8_t i;
uint8_t reg_val;
char buff[BUFF_MAX];
//ThhmmssDDMMYYYY aka set time
if (cmd[0] == 84 && cmdsize == 15)
{
rtc.set(
inp2toi(cmd, 5),
inp2toi(cmd, 3),
inp2toi(cmd, 1),
inp2toi(cmd, 7),
inp2toi(cmd, 9),
inp2toi(cmd, 11) * 100 + inp2toi(cmd, 13)
); //sec, min, hour, day, month, year
Serial.println("OK");
}
}
// just output the time
void printTime()
{
uint8_t sec, min, hour, day, month;
uint16_t year;
//get time from RTC
rtc.get(&sec, &min, &hour, &day, &month, &year);
//serial output
Serial.print("\nTime: ");
Serial.print(hour, DEC);
Serial.print(":");
Serial.print(min, DEC);
Serial.print(":");
Serial.print(sec, DEC);
Serial.print("\nDate: ");
Serial.print(day, DEC);
Serial.print(".");
Serial.print(month, DEC);
Serial.print(".");
Serial.print(year, DEC);
}
uint8_t inp2toi(char *cmd, const uint16_t seek)
{
uint8_t rv;
rv = (cmd[seek] - 48) * 10 + cmd[seek + 1] - 48;
return rv;
}

13
shields/Real Time Clock RV 8523 Breakout/RV8523 Library/library.json

@ -0,0 +1,13 @@
{
"name": "RV8523",
"keywords": "i2c, rtc, time, clock",
"description": "RV-8523 RTC (Real-Time-Clock)",
"include": "RV8523",
"repository":
{
"type": "git",
"url": "https://github.com/watterott/Arduino-Libs.git"
},
"frameworks": "arduino",
"platforms": "atmelavr"
}

9
shields/Real Time Clock RV 8523 Breakout/RV8523 Library/library.properties

@ -0,0 +1,9 @@
name=RV8523
version=1.0.0
author=Watterott
maintainer=Watterott
sentence=RV-8523 RTC (Real-Time-Clock)
paragraph=RV-8523 RTC (Real-Time-Clock)
category=Timing
url=https://github.com/watterott/Arduino-Libs
architectures=*

BIN
shields/Real Time Clock RV 8523 Breakout/RV8523-RTC-Breakout_v10.pdf

Binary file not shown.

BIN
shields/Seeeed Studio Relay Shield v3/img/High_Level_Control3.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
shields/Seeeed Studio Relay Shield v3/img/Low_Level_Control4.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
shields/Seeeed Studio Relay Shield v3/img/Motor-shield-schematic-drawing.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
shields/Seeeed Studio Relay Shield v3/img/Relay_Shield_Connector.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 KiB

BIN
shields/Seeeed Studio Relay Shield v3/img/Relay_Shield_L_v3.0.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

BIN
shields/Seeeed Studio Relay Shield v3/img/Relay_Shield_v3.0.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 KiB

BIN
shields/Seeeed Studio Relay Shield v3/img/Two-relay-shields-one-arduino.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

163
shields/Seeeed Studio Relay Shield v3/readme.md

@ -0,0 +1,163 @@
---
title: Relay Shield v3.0
category: Arduino
bzurl: https://www.seeedstudio.com/Relay-Shield-v3.0-p-2440.html
oldwikiname: Relay Shield v3.0
prodimagename: Relay_Shield_L_v3.0.jpg
surveyurl: https://www.surveymonkey.com/r/relay-shiel-v3
sku: 103030009
---
---
![](https://github.com/SeeedDocument/Relay_Shield_v3.0/raw/master/img/Relay_Shield_L_v3.0.jpg)
The Relay Shield provides a solution for controlling high current devices that cannot be controlled by the Arduino’s Digital I/O pins due to their current and voltage limits.
The Relay Shield features four high quality relays and provides NO/NC interfaces, four dynamic LED indicators to show the on/off state of each relay, and the standardized shield form factor to provide a smooth connection to the Arduino/Seeeduino board or other Arduino compatible boards.
[![](https://github.com/SeeedDocument/Seeed-WiKi/raw/master/docs/images/300px-Get_One_Now_Banner-ragular.png)](https://www.seeedstudio.com/Relay-Shield-v3.0-p-2440.html)
## Features
---
- Arudino Uno/Leonardo/Seeeduino compatible; Other board or microcontroller via jumper cables
- Interface via digital I/O pins 4,5,6, and 7
- Relay screw terminals
- Standardized shield shape and design
- LED working status indicators for each relay
- High quality relays
- COM, NO (Normally Open), and NC (Normally Closed) relay pins for each relay
- Update pin SCL, SDA, IOREF, NC.
## Specification
|Item| Min |Typical |Max |Unit|
|---|:---:|:---:|:---:|:---:|
|Supply Voltage |4.75 |5| 5.25 |VDC|
|Working Current |8| /| 250| mA|
|Switching Voltage| /| /| 35| VDC|
|Switching Current| /| /| 8|A|
|Frequency| /| 1| /| HZ|
|Switching Power| /| /| 70| W|
|Relay Life| 100,000| /| /| Cycle|
|ESD contact discharge|- |±4 |-|KV|
|ESD air discharge|-| ±8|-| KV|
|Dimension|-| 68.7X53.5X30.8|-| mm|
|Net Weight|-| 55±2|-| g|
!!!Cautions
Place 2 layers of electrical tape on the top of the Arduino's usb connector. This will prevent the relay shield from making contact. Do not operate voltage more than 35V DC.
## Shield Interface Description
---
![](https://github.com/SeeedDocument/Relay_Shield_v3.0/raw/master/img/Relay_Shield_v3.0.png)
- Digital 4 – controls RELAY4’s COM4 pin (located in J4)
- Digital 5 – controls RELAY3’s COM3 pin (located in J3)
- Digital 6 – controls RELAY2’s COM2 pin (located in J2)
- Digital 7 – controls RELAY1’s COM1 pin (located in J1)
**J1 Interface/Terminal Pin Description:**
- **COM1 (Common Pin)** : The relay pin controlled from the digital pin.
- **NC1 (Normally Closed)**: This terminal will be connected to COM1 when the RELAY1 control pin (Digital 7 I/O pin) is set low and disconnected when the RELAY1 control pin is set high.
- **NO1 (Normally Open)**: This terminal will be connected to COM1 when the RELAY1 control pin (Digital 7 I/O pin) is set high and disconnected when the RELAY1 control pin is set low.
**Terminals J2-4 are similar to J1 except that they control RELAY2-RELAY4 respectively. **
!!!Note
Only four Arduino Digital I/O pins, pins 4-7, are required to control the four different relays. Additionally the 5V and two GND Arduino pins are also required to power up the Relay Shield.
## Relays Operation/Tutorial
---
Relays are basically electromagnetic switches: when the relay is energized by the control circuit (i.e. when a voltage and current is applied to the coil), the current and coil create a magnetic field which is able to attract the COM terminal towards the NO terminal, when the control circuit removes the applied voltage and current the COM terminal returns to contact the NC terminal due to a mechanical force (usually a spring).
Some practical relay applications include: control of high voltage using low voltage, motor control, remote control, anti-hearing alarm, automatic temperature alarm, incubators and son on.
A motor control application with one relay and one motor is shown below:
![](https://github.com/SeeedDocument/Relay_Shield_v3.0/raw/master/img/Low_Level_Control4.jpg)
![](https://github.com/SeeedDocument/Relay_Shield_v3.0/raw/master/img/High_Level_Control3.jpg)
In the case of the Relay Shield, the two “Control Circuit” terminals for each of the four relays are controlled by only one Arduino Digital I/O pin. Pins 4, 5, 6, and 7 control relays 4, 3, 2, and 1 respectively.
## Relay Shield Example(s)/Usage
Now that you know how a relay works internally, let us show you how to use the Relay Shield.
**Example #1: DC Motor Control**
1.Stack the Relay Shield onto the Arduino development board.
2.Connect the Arduino to the PC using a USB cable.
3.We will use RELAY3 to control the DC motor. Connect the DC motor and Relay Shield as shown in the schematic and figure below:
![](https://github.com/SeeedDocument/Relay_Shield_v3.0/raw/master/img/Motor-shield-schematic-drawing.png)
![](https://github.com/SeeedDocument/Relay_Shield_v3.0/raw/master/img/Relay_Shield_Connector.jpg)
!!!Note
The external power supply in the figure above can be a battery or power supply. The external supply must be able to provide enough current and be set to the correct voltage for the motor. In our testing, we used a lithium battery as the external power supply for the motor.
4.Start the Arduino IDE and upload the following code to the Arduino board:
```
int MotorControl = 5; // Digital Arduino Pin used to control the motor
// the setup routine runs once when you press reset:
void setup() {
// declare pin 5 to be an output:
pinMode(MotorControl, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(MotorControl,HIGH);// NO3 and COM3 Connected (the motor is running)
delay(1000); // wait 1000 milliseconds (1 second)
digitalWrite(MotorControl,LOW);// NO3 and COM3 Disconnected (the motor is not running)
delay(1000); // wait 1000 milliseconds (1 second)
}
```
When you have uploaded the code to your Arduino/Seeeduino board the motor should run one second, stop for another second and repeat the process indefinitely. When the motor is running (NO3 and COM3 are connected), the NO3 LED indicator will be lit.
**Example #2: How to Use More Than One Relay Shield With Only One Arduino/Seeeduino Board**
Because the Relay Shield uses digital pins on the Arduino to control each the relays, more than one Relay Shield can be used with the same Arduino board, to do so simply follow these steps:
1.Stack one of the Relay Shields (let’s call this one Relay Shield #1) onto the Arduino development board
2.Connect another Relay Shield (let’s call this one Relay Shield #2) using jumper cables/wires to Relay Shield #1 as shown in the figure below:
![](https://github.com/SeeedDocument/Relay_Shield_v3.0/raw/master/img/Two-relay-shields-one-arduino.png)
- Relay Shield #1 GND pins are connected to Relay Shield #2 GND pins
- Relay Shield #1 5V pin is connected to Relay Shield #2 5V pin
- Relay Shield #1 Digital Pins 8, 9, 10, and 11, are connected to Relay Shield #2 Digital Pins 7, 6, 5, and 4 respectively.
3.Now you can control relays 1, 2, 3, and 4 in Relay Shield #2 using the Arduino’s 8, 9, 10, and 11 digital I/O pins. See sample code below for controlling RELAY1 in Relay Shield #2:
```
int relay1inShield2 = 8; // Digital Arduino Pin 8 is used to control relay 1 in Relay Shield #2
// the setup routine runs once when you press reset:
void setup() {
// declare pin 8 to be an output:
pinMode(relay1inShield2, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(relay1inShield2,HIGH); // relay is energized (NO is connected to COM)
delay(1000); // wait 1000 milliseconds (1 second)
digitalWrite(relay1inShield2,LOW); // NO is disconnected from COM
delay(1000); // wait 1000 milliseconds (1 second)
}
```
## Related Reading
---
- [FAQ of Relay Shield ](http://support.seeedstudio.com/knowledgebase/articles/462030-relay-shield-sku-sld01101p)
## Resource
---
- [Relay Shield v3.0](https://github.com/SeeedDocument/Relay_Shield_v3.0/raw/master/res/Relay_Shield_v3.0.zip)
Loading…
Cancel
Save