update to 1.61 2020-04-20
- Release under GPL V3 (1.60) - Added yield() call in runToPosition(), so that platforms like esp8266 dont hang/crash during long runs.
This commit is contained in:
@ -284,7 +284,7 @@ Protected Attributes</h2></td></tr>
|
||||
</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#a608b2395b64ac15451d16d0371fe13ce">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#aa279a50d30d0413f570c692cff071643">enableOutputs()</a>. </p><dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramdir">[in]</td><td class="paramname">interface</td><td>Number of pins to interface to. Integer values are supported, but it is preferred to use the <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5">MotorInterfaceType</a> symbolic names. <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5ac3523e4cf6763ba518d16fec3708ef23" title="Stepper Driver, 2 driver pins required. ">AccelStepper::DRIVER</a> (1) means a stepper driver (with Step and Direction pins). If an enable line is also needed, call <a class="el" href="classAccelStepper.html#a56a81c5f00d02ca19646718e88e974c0">setEnablePin()</a> after construction. You may also invert the pins using <a class="el" href="classAccelStepper.html#ac62cae590c2f9c303519a3a1c4adc8ab">setPinsInverted()</a>. <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5a62a305b52f749ff8c89138273fbb012d" title="2 wire stepper, 2 motor pins required ">AccelStepper::FULL2WIRE</a> (2) means a 2 wire stepper (2 pins required). <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5a0b8eea5cf0f8ce70b1959d2977ccc996" title="3 wire stepper, such as HDD spindle, 3 motor pins required ">AccelStepper::FULL3WIRE</a> (3) means a 3 wire stepper, such as HDD spindle (3 pins required). <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5adedd394a375190a3df8d4519c0d4dc2f" title="4 wire full stepper, 4 motor pins required ">AccelStepper::FULL4WIRE</a> (4) means a 4 wire stepper (4 pins required). <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5a00c2387a5af43d8e97639699ab7a5c7f" title="3 wire half stepper, such as HDD spindle, 3 motor pins required ">AccelStepper::HALF3WIRE</a> (6) means a 3 wire half stepper, such as HDD spindle (3 pins required) <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5aecc0900c55b777d2e885581b8c434b07" title="4 wire half stepper, 4 motor pins required ">AccelStepper::HALF4WIRE</a> (8) means a 4 wire half stepper (4 pins required) Defaults to <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5adedd394a375190a3df8d4519c0d4dc2f" title="4 wire full stepper, 4 motor pins required ">AccelStepper::FULL4WIRE</a> (4) pins. </td></tr>
|
||||
<tr><td class="paramdir">[in]</td><td class="paramname">interface</td><td>Number of pins to interface to. Integer values are supported, but it is preferred to use the <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5">MotorInterfaceType</a> symbolic names. <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5ac3523e4cf6763ba518d16fec3708ef23" title="Stepper Driver, 2 driver pins required. ">AccelStepper::DRIVER</a> (1) means a stepper driver (with Step and Direction pins). If an enable line is also needed, call <a class="el" href="classAccelStepper.html#a56a81c5f00d02ca19646718e88e974c0">setEnablePin()</a> after construction. You may also invert the pins using <a class="el" href="classAccelStepper.html#ac62cae590c2f9c303519a3a1c4adc8ab">setPinsInverted()</a>. Caution: DRIVER implements a blocking delay of minPulseWidth microseconds (default 1us) for each step. You can change this with <a class="el" href="classAccelStepper.html#af4d3818e691dad5dc518308796ccf154">setMinPulseWidth()</a>. <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5a62a305b52f749ff8c89138273fbb012d" title="2 wire stepper, 2 motor pins required ">AccelStepper::FULL2WIRE</a> (2) means a 2 wire stepper (2 pins required). <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5a0b8eea5cf0f8ce70b1959d2977ccc996" title="3 wire stepper, such as HDD spindle, 3 motor pins required ">AccelStepper::FULL3WIRE</a> (3) means a 3 wire stepper, such as HDD spindle (3 pins required). <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5adedd394a375190a3df8d4519c0d4dc2f" title="4 wire full stepper, 4 motor pins required ">AccelStepper::FULL4WIRE</a> (4) means a 4 wire stepper (4 pins required). <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5a00c2387a5af43d8e97639699ab7a5c7f" title="3 wire half stepper, such as HDD spindle, 3 motor pins required ">AccelStepper::HALF3WIRE</a> (6) means a 3 wire half stepper, such as HDD spindle (3 pins required) <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5aecc0900c55b777d2e885581b8c434b07" title="4 wire half stepper, 4 motor pins required ">AccelStepper::HALF4WIRE</a> (8) means a 4 wire half stepper (4 pins required) Defaults to <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5adedd394a375190a3df8d4519c0d4dc2f" title="4 wire full stepper, 4 motor pins required ">AccelStepper::FULL4WIRE</a> (4) pins. </td></tr>
|
||||
<tr><td class="paramdir">[in]</td><td class="paramname">pin1</td><td>Arduino digital pin number for motor pin 1. Defaults to pin 2. For a <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5ac3523e4cf6763ba518d16fec3708ef23" title="Stepper Driver, 2 driver pins required. ">AccelStepper::DRIVER</a> (interface==1), this is the Step input to the driver. Low to high transition means to step) </td></tr>
|
||||
<tr><td class="paramdir">[in]</td><td class="paramname">pin2</td><td>Arduino digital pin number for motor pin 2. Defaults to pin 3. For a <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5ac3523e4cf6763ba518d16fec3708ef23" title="Stepper Driver, 2 driver pins required. ">AccelStepper::DRIVER</a> (interface==1), this is the Direction input the driver. High means forward. </td></tr>
|
||||
<tr><td class="paramdir">[in]</td><td class="paramname">pin3</td><td>Arduino digital pin number for motor pin 3. Defaults to pin 4. </td></tr>
|
||||
@ -385,7 +385,7 @@ Protected Attributes</h2></td></tr>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>The currently motor position. </p><dl class="section return"><dt>Returns</dt><dd>the current motor position in steps. Positive is clockwise from the 0 position. </dd></dl>
|
||||
<p>The current motor position. </p><dl class="section return"><dt>Returns</dt><dd>the current motor position in steps. Positive is clockwise from the 0 position. </dd></dl>
|
||||
|
||||
<p class="reference">Referenced by <a class="el" href="classMultiStepper.html#a291fec32a79390b6eb00296cffac49ee">MultiStepper::moveTo()</a>.</p>
|
||||
|
||||
@ -501,7 +501,7 @@ Protected Attributes</h2></td></tr>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>returns the maximum speed configured for this stepper that was previously set by <a class="el" href="classAccelStepper.html#abee8d466229b87accba33d6ec929c18f">setMaxSpeed()</a>; </p><dl class="section return"><dt>Returns</dt><dd>The currently configured maximum speed </dd></dl>
|
||||
<p>Returns the maximum speed configured for this stepper that was previously set by <a class="el" href="classAccelStepper.html#abee8d466229b87accba33d6ec929c18f">setMaxSpeed()</a>; </p><dl class="section return"><dt>Returns</dt><dd>The currently configured maximum speed </dd></dl>
|
||||
|
||||
<p class="reference">Referenced by <a class="el" href="classMultiStepper.html#a291fec32a79390b6eb00296cffac49ee">MultiStepper::moveTo()</a>.</p>
|
||||
|
||||
@ -522,7 +522,7 @@ Protected Attributes</h2></td></tr>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>Set the target position relative to the current position </p><dl class="params"><dt>Parameters</dt><dd>
|
||||
<p>Set the target position relative to the current position. </p><dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramdir">[in]</td><td class="paramname">relative</td><td>The desired position relative to the current position. Negative is anticlockwise from the current position. </td></tr>
|
||||
</table>
|
||||
@ -577,7 +577,7 @@ Protected Attributes</h2></td></tr>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>Poll the motor and step it if a step is due, implementing accelerations and decelerations to acheive the target position. You must call this as frequently as possible, but at least once per minimum step time interval, preferably in your main loop. Note that each call to <a class="el" href="classAccelStepper.html#a608b2395b64ac15451d16d0371fe13ce">run()</a> will make at most one step, and then only when a step is due, based on the current speed and the time since the last step. </p><dl class="section return"><dt>Returns</dt><dd>true if the motor is still running to the target position. </dd></dl>
|
||||
<p>Poll the motor and step it if a step is due, implementing accelerations and decelerations to achieve the target position. You must call this as frequently as possible, but at least once per minimum step time interval, preferably in your main loop. Note that each call to <a class="el" href="classAccelStepper.html#a608b2395b64ac15451d16d0371fe13ce">run()</a> will make at most one step, and then only when a step is due, based on the current speed and the time since the last step. </p><dl class="section return"><dt>Returns</dt><dd>true if the motor is still running to the target position. </dd></dl>
|
||||
|
||||
<p class="reference">References <a class="el" href="classAccelStepper.html#affbee789b5c19165846cf0409860ae79">computeNewSpeed()</a>, <a class="el" href="classAccelStepper.html#a748665c3962e66fbc0e9373eb14c69c1">distanceToGo()</a>, and <a class="el" href="classAccelStepper.html#aa4a6bdf99f698284faaeb5542b0b7514">runSpeed()</a>.</p>
|
||||
|
||||
@ -621,7 +621,7 @@ Protected Attributes</h2></td></tr>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>Runs at the currently selected speed until the target position is reached Does not implement accelerations. </p><dl class="section return"><dt>Returns</dt><dd>true if it stepped </dd></dl>
|
||||
<p>Runs at the currently selected speed until the target position is reached. Does not implement accelerations. </p><dl class="section return"><dt>Returns</dt><dd>true if it stepped </dd></dl>
|
||||
|
||||
<p class="reference">References <a class="el" href="classAccelStepper.html#a35162cdf8ed9a98f98984c177d5ade58">_direction</a>, <a class="el" href="classAccelStepper.html#a7468f91a925c689c3ba250f8d074d228a6959a4549f734bd771d418f995ba4fb4">DIRECTION_CCW</a>, <a class="el" href="classAccelStepper.html#a7468f91a925c689c3ba250f8d074d228ad604e0047f7cb47662c5a1cf6999337c">DIRECTION_CW</a>, and <a class="el" href="classAccelStepper.html#aa4a6bdf99f698284faaeb5542b0b7514">runSpeed()</a>.</p>
|
||||
|
||||
@ -725,6 +725,8 @@ Protected Attributes</h2></td></tr>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<p class="reference">Referenced by <a class="el" href="classMultiStepper.html#a26c2f53b1e7ddf5d5dfb333f6fb7fb92">MultiStepper::run()</a>.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="a56a81c5f00d02ca19646718e88e974c0"></a>
|
||||
@ -973,7 +975,7 @@ Protected Attributes</h2></td></tr>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>The most recently set speed </p><dl class="section return"><dt>Returns</dt><dd>the most recent speed in steps per second </dd></dl>
|
||||
<p>The most recently set speed. </p><dl class="section return"><dt>Returns</dt><dd>the most recent speed in steps per second </dd></dl>
|
||||
|
||||
<p class="reference">Referenced by <a class="el" href="classAccelStepper.html#abee8d466229b87accba33d6ec929c18f">setMaxSpeed()</a>, and <a class="el" href="classAccelStepper.html#ae79c49ad69d5ccc9da0ee691fa4ca235">setSpeed()</a>.</p>
|
||||
|
||||
|
@ -46,7 +46,7 @@ $(function() {
|
||||
<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: </p><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>Most API functions never delay() or block (unless otherwise stated) </li>
|
||||
<li>Supports 2, 3 and 4 wire steppers, plus 3 and 4 wire half steppers. </li>
|
||||
<li>Supports alternate stepping functions to enable support of AFMotor (<a href="https://github.com/adafruit/Adafruit-Motor-Shield-library">https://github.com/adafruit/Adafruit-Motor-Shield-library</a>) </li>
|
||||
<li>Supports stepper drivers such as the Sparkfun EasyDriver (based on 3967 driver chip) </li>
|
||||
@ -54,7 +54,7 @@ $(function() {
|
||||
<li>Extensive API </li>
|
||||
<li>Subclass support</li>
|
||||
</ul>
|
||||
<p>The latest version of this documentation can be downloaded from <a href="http://www.airspayce.com/mikem/arduino/AccelStepper">http://www.airspayce.com/mikem/arduino/AccelStepper</a> The version of the package that this documentation refers to can be downloaded from <a href="http://www.airspayce.com/mikem/arduino/AccelStepper/AccelStepper-1.59.zip">http://www.airspayce.com/mikem/arduino/AccelStepper/AccelStepper-1.59.zip</a></p>
|
||||
<p>The latest version of this documentation can be downloaded from <a href="http://www.airspayce.com/mikem/arduino/AccelStepper">http://www.airspayce.com/mikem/arduino/AccelStepper</a> The version of the package that this documentation refers to can be downloaded from <a href="http://www.airspayce.com/mikem/arduino/AccelStepper/AccelStepper-1.61.zip">http://www.airspayce.com/mikem/arduino/AccelStepper/AccelStepper-1.61.zip</a></p>
|
||||
<p>Example Arduino programs are included to show the main modes of use.</p>
|
||||
<p>You can also find online help and discussion at <a href="http://groups.google.com/group/accelstepper">http://groups.google.com/group/accelstepper</a> Please use that group for all questions and discussions on this topic. Do not contact the author directly, unless it is to discuss commercial licensing. Before asking a question or reporting a bug, please read</p><ul>
|
||||
<li><a href="http://en.wikipedia.org/wiki/Wikipedia:Reference_desk/How_to_ask_a_software_question">http://en.wikipedia.org/wiki/Wikipedia:Reference_desk/How_to_ask_a_software_question</a></li>
|
||||
@ -74,8 +74,8 @@ $(function() {
|
||||
<dl class="section user"><dt>Trademarks</dt><dd></dd></dl>
|
||||
<p><a class="el" href="classAccelStepper.html" title="Support for stepper motors with acceleration etc. ">AccelStepper</a> is a trademark of AirSpayce Pty Ltd. The <a class="el" href="classAccelStepper.html" title="Support for stepper motors with acceleration etc. ">AccelStepper</a> mark was first used on April 26 2010 for international trade, and is used only in relation to motor control hardware and software. It is not to be confused with any other similar marks covering other goods and services.</p>
|
||||
<dl class="section user"><dt>Copyright</dt><dd></dd></dl>
|
||||
<p>This software is Copyright (C) 2010-2018 Mike McCauley. Use is subject to license conditions. The main licensing options available are GPL V2 or Commercial:</p>
|
||||
<dl class="section user"><dt>Open Source Licensing GPL V2</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="https://www.gnu.org/licenses/gpl-2.0.html">https://www.gnu.org/licenses/gpl-2.0.html</a></dd></dl>
|
||||
<p>This software is Copyright (C) 2010-2018 Mike McCauley. Use is subject to license conditions. The main licensing options available are GPL V3 or Commercial:</p>
|
||||
<dl class="section user"><dt>Open Source Licensing GPL V3</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 23 when your application is distributed. See <a href="https://www.gnu.org/licenses/gpl-3.0.html">https://www.gnu.org/licenses/gpl-3.0.html</a></dd></dl>
|
||||
<dl class="section user"><dt>Commercial Licensing</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. To purchase a commercial license, contact <a href="#" onclick="location.href='mai'+'lto:'+'inf'+'o@'+'air'+'sp'+'ayc'+'e.'+'com'; return false;">info@<span style="display: none;">.nosp@m.</span>airs<span style="display: none;">.nosp@m.</span>payce<span style="display: none;">.nosp@m.</span>.com</a></dd></dl>
|
||||
<dl class="section user"><dt>Revision History</dt><dd></dd></dl>
|
||||
<dl class="section version"><dt>Version</dt><dd>1.0 Initial release</dd>
|
||||
@ -209,7 +209,11 @@ $(function() {
|
||||
<dd>
|
||||
1.58 2018-04-13 Add initialisation for _enableInverted in constructor. </dd>
|
||||
<dd>
|
||||
1.59 2018-08-28 Update commercial licensing, remove binpress.</dd></dl>
|
||||
1.59 2018-08-28 Update commercial licensing, remove binpress. </dd>
|
||||
<dd>
|
||||
1.60 2020-03-07 Release under GPL V3 </dd>
|
||||
<dd>
|
||||
1.61 2020-04-20 Added yield() call in runToPosition(), so that platforms like esp8266 dont hang/crash during long runs.</dd></dl>
|
||||
<dl class="section author"><dt>Author</dt><dd>Mike McCauley (<a href="#" onclick="location.href='mai'+'lto:'+'mik'+'em'+'@ai'+'rs'+'pay'+'ce'+'.co'+'m'; return false;">mikem<span style="display: none;">.nosp@m.</span>@air<span style="display: none;">.nosp@m.</span>spayc<span style="display: none;">.nosp@m.</span>e.co<span style="display: none;">.nosp@m.</span>m</a>) DO NOT CONTACT THE AUTHOR DIRECTLY: USE THE LISTS </dd></dl>
|
||||
</div></div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user