polargraph_arduino/libraries/AccelStepper/doc/classAccelStepper.html

1252 lines
78 KiB
HTML
Raw Permalink Normal View History

2019-08-31 22:31:33 +02:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>AccelStepper: AccelStepper Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">AccelStepper
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;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>
<li><a href="examples.html"><span>Examples</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-types">Protected Types</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="classAccelStepper-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">AccelStepper Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Support for stepper motors with acceleration etc.
<a href="classAccelStepper.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="AccelStepper_8h_source.html">AccelStepper.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a73bdecf1273d98d8c5fbcb764cabeea5"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5">MotorInterfaceType</a> { <br/>
&#160;&#160;<a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5af5bb99ad9d67ad2d85f840e3abcfe068">FUNCTION</a> = 0,
<a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5ac3523e4cf6763ba518d16fec3708ef23">DRIVER</a> = 1,
<a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5a62a305b52f749ff8c89138273fbb012d">FULL2WIRE</a> = 2,
<a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5a0b8eea5cf0f8ce70b1959d2977ccc996">FULL3WIRE</a> = 3,
<br/>
&#160;&#160;<a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5adedd394a375190a3df8d4519c0d4dc2f">FULL4WIRE</a> = 4,
<a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5a00c2387a5af43d8e97639699ab7a5c7f">HALF3WIRE</a> = 6,
<a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5aecc0900c55b777d2e885581b8c434b07">HALF4WIRE</a> = 8
<br/>
}</td></tr>
<tr class="memdesc:a73bdecf1273d98d8c5fbcb764cabeea5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Symbolic names for number of pins. Use this in the pins argument the <a class="el" href="classAccelStepper.html" title="Support for stepper motors with acceleration etc.">AccelStepper</a> constructor to provide a symbolic name for the number of pins to use. <a href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5">More...</a><br/></td></tr>
<tr class="separator:a73bdecf1273d98d8c5fbcb764cabeea5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a3bc75bd6571b98a6177838ca81ac39ab"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a3bc75bd6571b98a6177838ca81ac39ab">AccelStepper</a> (uint8_t interface=<a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5adedd394a375190a3df8d4519c0d4dc2f">AccelStepper::FULL4WIRE</a>, uint8_t pin1=2, uint8_t pin2=3, uint8_t pin3=4, uint8_t pin4=5, bool enable=true)</td></tr>
<tr class="separator:a3bc75bd6571b98a6177838ca81ac39ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afa3061ce813303a8f2fa206ee8d012bd"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#afa3061ce813303a8f2fa206ee8d012bd">AccelStepper</a> (void(*forward)(), void(*backward)())</td></tr>
<tr class="separator:afa3061ce813303a8f2fa206ee8d012bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ace236ede35f87c63d18da25810ec9736"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#ace236ede35f87c63d18da25810ec9736">moveTo</a> (long absolute)</td></tr>
<tr class="separator:ace236ede35f87c63d18da25810ec9736"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a68942c66e78fb7f7b5f0cdade6eb7f06"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a68942c66e78fb7f7b5f0cdade6eb7f06">move</a> (long relative)</td></tr>
<tr class="separator:a68942c66e78fb7f7b5f0cdade6eb7f06"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a608b2395b64ac15451d16d0371fe13ce"><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a608b2395b64ac15451d16d0371fe13ce">run</a> ()</td></tr>
<tr class="separator:a608b2395b64ac15451d16d0371fe13ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa4a6bdf99f698284faaeb5542b0b7514"><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#aa4a6bdf99f698284faaeb5542b0b7514">runSpeed</a> ()</td></tr>
<tr class="separator:aa4a6bdf99f698284faaeb5542b0b7514"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abee8d466229b87accba33d6ec929c18f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#abee8d466229b87accba33d6ec929c18f">setMaxSpeed</a> (float <a class="el" href="classAccelStepper.html#a4f0989d0ae264e7eadfe1fa720769fb6">speed</a>)</td></tr>
<tr class="separator:abee8d466229b87accba33d6ec929c18f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adfb19e3cd2a028a1fe78131787604fd1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#adfb19e3cd2a028a1fe78131787604fd1">setAcceleration</a> (float acceleration)</td></tr>
<tr class="separator:adfb19e3cd2a028a1fe78131787604fd1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae79c49ad69d5ccc9da0ee691fa4ca235"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#ae79c49ad69d5ccc9da0ee691fa4ca235">setSpeed</a> (float <a class="el" href="classAccelStepper.html#a4f0989d0ae264e7eadfe1fa720769fb6">speed</a>)</td></tr>
<tr class="separator:ae79c49ad69d5ccc9da0ee691fa4ca235"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4f0989d0ae264e7eadfe1fa720769fb6"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a4f0989d0ae264e7eadfe1fa720769fb6">speed</a> ()</td></tr>
<tr class="separator:a4f0989d0ae264e7eadfe1fa720769fb6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a748665c3962e66fbc0e9373eb14c69c1"><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a748665c3962e66fbc0e9373eb14c69c1">distanceToGo</a> ()</td></tr>
<tr class="separator:a748665c3962e66fbc0e9373eb14c69c1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a96685e0945b7cf75d5959da679cd911e"><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a96685e0945b7cf75d5959da679cd911e">targetPosition</a> ()</td></tr>
<tr class="separator:a96685e0945b7cf75d5959da679cd911e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5dce13ab2a1b02b8f443318886bf6fc5"><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a5dce13ab2a1b02b8f443318886bf6fc5">currentPosition</a> ()</td></tr>
<tr class="separator:a5dce13ab2a1b02b8f443318886bf6fc5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d917f014317fb9d3b5dc14e66f6c689"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a9d917f014317fb9d3b5dc14e66f6c689">setCurrentPosition</a> (long position)</td></tr>
<tr class="separator:a9d917f014317fb9d3b5dc14e66f6c689"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a344f58fef8cc34ac5aa75ba4b665d21c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a344f58fef8cc34ac5aa75ba4b665d21c">runToPosition</a> ()</td></tr>
<tr class="separator:a344f58fef8cc34ac5aa75ba4b665d21c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9270d20336e76ac1fd5bcd5b9c34f301"><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a9270d20336e76ac1fd5bcd5b9c34f301">runSpeedToPosition</a> ()</td></tr>
<tr class="separator:a9270d20336e76ac1fd5bcd5b9c34f301"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a176c5d2e4c2f21e9e92b12e39a6f0e67"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a176c5d2e4c2f21e9e92b12e39a6f0e67">runToNewPosition</a> (long position)</td></tr>
<tr class="separator:a176c5d2e4c2f21e9e92b12e39a6f0e67"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a638817b85aed9d5cd15c76a76c00aced"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a638817b85aed9d5cd15c76a76c00aced">stop</a> ()</td></tr>
<tr class="separator:a638817b85aed9d5cd15c76a76c00aced"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3591e29a236e2935afd7f64ff6c22006"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a3591e29a236e2935afd7f64ff6c22006">disableOutputs</a> ()</td></tr>
<tr class="separator:a3591e29a236e2935afd7f64ff6c22006"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa279a50d30d0413f570c692cff071643"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#aa279a50d30d0413f570c692cff071643">enableOutputs</a> ()</td></tr>
<tr class="separator:aa279a50d30d0413f570c692cff071643"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af4d3818e691dad5dc518308796ccf154"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#af4d3818e691dad5dc518308796ccf154">setMinPulseWidth</a> (unsigned int minWidth)</td></tr>
<tr class="separator:af4d3818e691dad5dc518308796ccf154"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a56a81c5f00d02ca19646718e88e974c0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a56a81c5f00d02ca19646718e88e974c0">setEnablePin</a> (uint8_t enablePin=0xff)</td></tr>
<tr class="separator:a56a81c5f00d02ca19646718e88e974c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac62cae590c2f9c303519a3a1c4adc8ab"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#ac62cae590c2f9c303519a3a1c4adc8ab">setPinsInverted</a> (bool directionInvert=false, bool stepInvert=false, bool enableInvert=false)</td></tr>
<tr class="separator:ac62cae590c2f9c303519a3a1c4adc8ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a38298ac2dd852fb22259f6c4bbe08c94"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a38298ac2dd852fb22259f6c4bbe08c94">setPinsInverted</a> (bool pin1Invert, bool pin2Invert, bool pin3Invert, bool pin4Invert, bool enableInvert)</td></tr>
<tr class="separator:a38298ac2dd852fb22259f6c4bbe08c94"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-types"></a>
Protected Types</h2></td></tr>
<tr class="memitem:a7468f91a925c689c3ba250f8d074d228"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a7468f91a925c689c3ba250f8d074d228">Direction</a> { <a class="el" href="classAccelStepper.html#a7468f91a925c689c3ba250f8d074d228a6959a4549f734bd771d418f995ba4fb4">DIRECTION_CCW</a> = 0,
<a class="el" href="classAccelStepper.html#a7468f91a925c689c3ba250f8d074d228ad604e0047f7cb47662c5a1cf6999337c">DIRECTION_CW</a> = 1
}</td></tr>
<tr class="memdesc:a7468f91a925c689c3ba250f8d074d228"><td class="mdescLeft">&#160;</td><td class="mdescRight">Direction indicator Symbolic names for the direction the motor is turning. <a href="classAccelStepper.html#a7468f91a925c689c3ba250f8d074d228">More...</a><br/></td></tr>
<tr class="separator:a7468f91a925c689c3ba250f8d074d228"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:affbee789b5c19165846cf0409860ae79"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#affbee789b5c19165846cf0409860ae79">computeNewSpeed</a> ()</td></tr>
<tr class="separator:affbee789b5c19165846cf0409860ae79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af3c2516b6ce7c1ecbc2004107bb2a9ce"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#af3c2516b6ce7c1ecbc2004107bb2a9ce">setOutputPins</a> (uint8_t mask)</td></tr>
<tr class="separator:af3c2516b6ce7c1ecbc2004107bb2a9ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a419121702399d8ac66df4cc47481f4"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a8a419121702399d8ac66df4cc47481f4">step</a> (long step)</td></tr>
<tr class="separator:a8a419121702399d8ac66df4cc47481f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2913db789e6fa05756579ff82fe6e7e"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#aa2913db789e6fa05756579ff82fe6e7e">step0</a> (long <a class="el" href="classAccelStepper.html#a8a419121702399d8ac66df4cc47481f4">step</a>)</td></tr>
<tr class="separator:aa2913db789e6fa05756579ff82fe6e7e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a63ef416bc039da539294e84a41e7d7dc"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a63ef416bc039da539294e84a41e7d7dc">step1</a> (long <a class="el" href="classAccelStepper.html#a8a419121702399d8ac66df4cc47481f4">step</a>)</td></tr>
<tr class="separator:a63ef416bc039da539294e84a41e7d7dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a674e48a6bf99e7ad1f013c1e4414565a"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a674e48a6bf99e7ad1f013c1e4414565a">step2</a> (long <a class="el" href="classAccelStepper.html#a8a419121702399d8ac66df4cc47481f4">step</a>)</td></tr>
<tr class="separator:a674e48a6bf99e7ad1f013c1e4414565a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad73c61aade2e10243dfb02aefa7ab8fd"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#ad73c61aade2e10243dfb02aefa7ab8fd">step3</a> (long <a class="el" href="classAccelStepper.html#a8a419121702399d8ac66df4cc47481f4">step</a>)</td></tr>
<tr class="separator:ad73c61aade2e10243dfb02aefa7ab8fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8910bd9218a54dfb7e2372a6d0bcca0c"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a8910bd9218a54dfb7e2372a6d0bcca0c">step4</a> (long <a class="el" href="classAccelStepper.html#a8a419121702399d8ac66df4cc47481f4">step</a>)</td></tr>
<tr class="separator:a8910bd9218a54dfb7e2372a6d0bcca0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b0faf1ebc0c584ab606c0c0f66986b0"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#a4b0faf1ebc0c584ab606c0c0f66986b0">step6</a> (long <a class="el" href="classAccelStepper.html#a8a419121702399d8ac66df4cc47481f4">step</a>)</td></tr>
<tr class="separator:a4b0faf1ebc0c584ab606c0c0f66986b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa909c6c3fcd3ea4b3ee1aa8b4d0f7e87"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAccelStepper.html#aa909c6c3fcd3ea4b3ee1aa8b4d0f7e87">step8</a> (long <a class="el" href="classAccelStepper.html#a8a419121702399d8ac66df4cc47481f4">step</a>)</td></tr>
<tr class="separator:aa909c6c3fcd3ea4b3ee1aa8b4d0f7e87"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Support for stepper motors with acceleration etc. </p>
<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="section user"><dt>Operation</dt><dd>This module operates by computing a step time in microseconds. The step time is recomputed after each step and after speed and acceleration parameters are changed by the caller. The time of each step is recorded in microseconds. The <a class="el" href="classAccelStepper.html#a608b2395b64ac15451d16d0371fe13ce">run()</a> function steps the motor if a new step is due. The <a class="el" href="classAccelStepper.html#a608b2395b64ac15451d16d0371fe13ce">run()</a> function must be called frequently until the motor is in the desired position, after which time <a class="el" href="classAccelStepper.html#a608b2395b64ac15451d16d0371fe13ce">run()</a> will do nothing.</dd></dl>
<dl class="section user"><dt>Positioning</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="section user"><dt>Caveats</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 <em>think</em> it is, relative to the initial starting point).</dd></dl>
<dl class="section user"><dt>Performance</dt><dd>The fastest motor speed that can be reliably supported is about 4000 steps per second at a clock frequency of 16 MHz on Arduino such as Uno etc. Faster processors can support faster stepping speeds. However, any speed less than that down to very slow speeds (much less than one per second) are also supported, provided the <a class="el" href="classAccelStepper.html#a608b2395b64ac15451d16d0371fe13ce">run()</a> function is called frequently enough to step the motor whenever required for the speed set. Calling <a class="el" href="classAccelStepper.html#adfb19e3cd2a028a1fe78131787604fd1">setAcceleration()</a> is expensive, since it requires a square root to be calculated. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="AFMotor_ConstantSpeed_8pde-example.html#_a0">AFMotor_ConstantSpeed.pde</a>, <a class="el" href="AFMotor_MultiStepper_8pde-example.html#_a0">AFMotor_MultiStepper.pde</a>, <a class="el" href="Blocking_8pde-example.html#_a0">Blocking.pde</a>, <a class="el" href="Bounce_8pde-example.html#_a0">Bounce.pde</a>, <a class="el" href="ConstantSpeed_8pde-example.html#_a0">ConstantSpeed.pde</a>, <a class="el" href="MotorShield_8pde-example.html#_a0">MotorShield.pde</a>, <a class="el" href="MultiStepper_8pde-example.html#_a0">MultiStepper.pde</a>, <a class="el" href="Overshoot_8pde-example.html#_a0">Overshoot.pde</a>, <a class="el" href="ProportionalControl_8pde-example.html#_a0">ProportionalControl.pde</a>, <a class="el" href="Quickstop_8pde-example.html#_a0">Quickstop.pde</a>, and <a class="el" href="Random_8pde-example.html#_a0">Random.pde</a>.</dd>
</dl></div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a class="anchor" id="a7468f91a925c689c3ba250f8d074d228"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="classAccelStepper.html#a7468f91a925c689c3ba250f8d074d228">AccelStepper::Direction</a></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Direction indicator Symbolic names for the direction the motor is turning. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="a7468f91a925c689c3ba250f8d074d228a6959a4549f734bd771d418f995ba4fb4"></a>DIRECTION_CCW</em>&nbsp;</td><td>
<p>Clockwise. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a7468f91a925c689c3ba250f8d074d228ad604e0047f7cb47662c5a1cf6999337c"></a>DIRECTION_CW</em>&nbsp;</td><td>
<p>Counter-Clockwise. </p>
</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a73bdecf1273d98d8c5fbcb764cabeea5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5">AccelStepper::MotorInterfaceType</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Symbolic names for number of pins. Use this in the pins argument the <a class="el" href="classAccelStepper.html" title="Support for stepper motors with acceleration etc.">AccelStepper</a> constructor to provide a symbolic name for the number of pins to use. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="a73bdecf1273d98d8c5fbcb764cabeea5af5bb99ad9d67ad2d85f840e3abcfe068"></a>FUNCTION</em>&nbsp;</td><td>
<p>Use the functional interface, implementing your own driver functions (internal use only) </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a73bdecf1273d98d8c5fbcb764cabeea5ac3523e4cf6763ba518d16fec3708ef23"></a>DRIVER</em>&nbsp;</td><td>
<p>Stepper Driver, 2 driver pins required. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a73bdecf1273d98d8c5fbcb764cabeea5a62a305b52f749ff8c89138273fbb012d"></a>FULL2WIRE</em>&nbsp;</td><td>
<p>2 wire stepper, 2 motor pins required </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a73bdecf1273d98d8c5fbcb764cabeea5a0b8eea5cf0f8ce70b1959d2977ccc996"></a>FULL3WIRE</em>&nbsp;</td><td>
<p>3 wire stepper, such as HDD spindle, 3 motor pins required </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a73bdecf1273d98d8c5fbcb764cabeea5adedd394a375190a3df8d4519c0d4dc2f"></a>FULL4WIRE</em>&nbsp;</td><td>
<p>4 wire full stepper, 4 motor pins required </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a73bdecf1273d98d8c5fbcb764cabeea5a00c2387a5af43d8e97639699ab7a5c7f"></a>HALF3WIRE</em>&nbsp;</td><td>
<p>3 wire half stepper, such as HDD spindle, 3 motor pins required </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a73bdecf1273d98d8c5fbcb764cabeea5aecc0900c55b777d2e885581b8c434b07"></a>HALF4WIRE</em>&nbsp;</td><td>
<p>4 wire half stepper, 4 motor pins required </p>
</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a3bc75bd6571b98a6177838ca81ac39ab"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">AccelStepper::AccelStepper </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>interface</em> = <code><a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5adedd394a375190a3df8d4519c0d4dc2f">AccelStepper::FULL4WIRE</a></code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>pin1</em> = <code>2</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>pin2</em> = <code>3</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>pin3</em> = <code>4</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>pin4</em> = <code>5</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>enable</em> = <code>true</code>&#160;</td>
</tr>
<tr>
<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#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. 1, 2, 4 or 8 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">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> (pins==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> (pins==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>
<tr><td class="paramdir">[in]</td><td class="paramname">pin4</td><td>Arduino digital pin number for motor pin 4. Defaults to pin 5. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">enable</td><td>If this is true (the default), enableOutpuys() will be called to enable the output pins at construction time. </td></tr>
</table>
</dd>
</dl>
<p>References <a class="el" href="classAccelStepper.html#a7468f91a925c689c3ba250f8d074d228a6959a4549f734bd771d418f995ba4fb4">DIRECTION_CCW</a>, and <a class="el" href="classAccelStepper.html#aa279a50d30d0413f570c692cff071643">enableOutputs()</a>.</p>
</div>
</div>
<a class="anchor" id="afa3061ce813303a8f2fa206ee8d012bd"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">AccelStepper::AccelStepper </td>
<td>(</td>
<td class="paramtype">void(*)()&#160;</td>
<td class="paramname"><em>forward</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void(*)()&#160;</td>
<td class="paramname"><em>backward</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Alternate Constructor which will call your own functions for forward and backward steps. You can have multiple simultaneous steppers, all moving at different speeds and accelerations, provided you call their <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. Any motor initialization should happen before hand, no pins are used or initialized. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">forward</td><td>void-returning procedure that will make a forward step </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">backward</td><td>void-returning procedure that will make a backward step </td></tr>
</table>
</dd>
</dl>
<p>References <a class="el" href="classAccelStepper.html#a7468f91a925c689c3ba250f8d074d228a6959a4549f734bd771d418f995ba4fb4">DIRECTION_CCW</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="affbee789b5c19165846cf0409860ae79"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::computeNewSpeed </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Forces the library to compute a new instantaneous speed and set that as the current speed. It is called by the library: </p>
<ul>
<li>after each step </li>
<li>after change to maxSpeed through <a class="el" href="classAccelStepper.html#abee8d466229b87accba33d6ec929c18f">setMaxSpeed()</a> </li>
<li>after change to acceleration through <a class="el" href="classAccelStepper.html#adfb19e3cd2a028a1fe78131787604fd1">setAcceleration()</a> </li>
<li>after change to target position (relative or absolute) through <a class="el" href="classAccelStepper.html#a68942c66e78fb7f7b5f0cdade6eb7f06">move()</a> or <a class="el" href="classAccelStepper.html#ace236ede35f87c63d18da25810ec9736">moveTo()</a> </li>
</ul>
<p>References <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#a748665c3962e66fbc0e9373eb14c69c1">distanceToGo()</a>.</p>
<p>Referenced by <a class="el" href="classAccelStepper.html#ace236ede35f87c63d18da25810ec9736">moveTo()</a>, <a class="el" href="classAccelStepper.html#a608b2395b64ac15451d16d0371fe13ce">run()</a>, <a class="el" href="classAccelStepper.html#adfb19e3cd2a028a1fe78131787604fd1">setAcceleration()</a>, and <a class="el" href="classAccelStepper.html#abee8d466229b87accba33d6ec929c18f">setMaxSpeed()</a>.</p>
</div>
</div>
<a class="anchor" id="a5dce13ab2a1b02b8f443318886bf6fc5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">long AccelStepper::currentPosition </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</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>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="Bounce_8pde-example.html#a5">Bounce.pde</a>, <a class="el" href="MultiStepper_8pde-example.html#a7">MultiStepper.pde</a>, <a class="el" href="Overshoot_8pde-example.html#a4">Overshoot.pde</a>, and <a class="el" href="Quickstop_8pde-example.html#a4">Quickstop.pde</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="a3591e29a236e2935afd7f64ff6c22006"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::disableOutputs </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </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#aa279a50d30d0413f570c692cff071643">enableOutputs()</a> before stepping again. </p>
<p>References <a class="el" href="classAccelStepper.html#af3c2516b6ce7c1ecbc2004107bb2a9ce">setOutputPins()</a>.</p>
</div>
</div>
<a class="anchor" id="a748665c3962e66fbc0e9373eb14c69c1"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">long AccelStepper::distanceToGo </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>The distance from the current position to the target position. </p>
<dl class="section return"><dt>Returns</dt><dd>the distance from the current position to the target position in steps. Positive is clockwise from the current position. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="Bounce_8pde-example.html#a4">Bounce.pde</a>, <a class="el" href="MultiStepper_8pde-example.html#a6">MultiStepper.pde</a>, and <a class="el" href="Random_8pde-example.html#a1">Random.pde</a>.</dd>
</dl>
<p>Referenced by <a class="el" href="classAccelStepper.html#affbee789b5c19165846cf0409860ae79">computeNewSpeed()</a>, and <a class="el" href="classAccelStepper.html#a344f58fef8cc34ac5aa75ba4b665d21c">runToPosition()</a>.</p>
</div>
</div>
<a class="anchor" id="aa279a50d30d0413f570c692cff071643"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::enableOutputs </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </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>
<p>References <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5adedd394a375190a3df8d4519c0d4dc2f">FULL4WIRE</a>, and <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5aecc0900c55b777d2e885581b8c434b07">HALF4WIRE</a>.</p>
<p>Referenced by <a class="el" href="classAccelStepper.html#a3bc75bd6571b98a6177838ca81ac39ab">AccelStepper()</a>.</p>
</div>
</div>
<a class="anchor" id="a68942c66e78fb7f7b5f0cdade6eb7f06"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::move </td>
<td>(</td>
<td class="paramtype">long&#160;</td>
<td class="paramname"><em>relative</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<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>
</dd>
</dl>
<p>References <a class="el" href="classAccelStepper.html#ace236ede35f87c63d18da25810ec9736">moveTo()</a>.</p>
<p>Referenced by <a class="el" href="classAccelStepper.html#a638817b85aed9d5cd15c76a76c00aced">stop()</a>.</p>
</div>
</div>
<a class="anchor" id="ace236ede35f87c63d18da25810ec9736"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::moveTo </td>
<td>(</td>
<td class="paramtype">long&#160;</td>
<td class="paramname"><em>absolute</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the target position. The <a class="el" href="classAccelStepper.html#a608b2395b64ac15451d16d0371fe13ce">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. Caution: <a class="el" href="classAccelStepper.html#ace236ede35f87c63d18da25810ec9736">moveTo()</a> also recalculates the speed for the next step. If you are trying to use constant speed movements, you should call <a class="el" href="classAccelStepper.html#ae79c49ad69d5ccc9da0ee691fa4ca235">setSpeed()</a> after calling <a class="el" href="classAccelStepper.html#ace236ede35f87c63d18da25810ec9736">moveTo()</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">absolute</td><td>The desired absolute position. Negative is anticlockwise from the 0 position. </td></tr>
</table>
</dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="Bounce_8pde-example.html#a3">Bounce.pde</a>, <a class="el" href="MultiStepper_8pde-example.html#a5">MultiStepper.pde</a>, <a class="el" href="Overshoot_8pde-example.html#a3">Overshoot.pde</a>, <a class="el" href="ProportionalControl_8pde-example.html#a2">ProportionalControl.pde</a>, <a class="el" href="Quickstop_8pde-example.html#a3">Quickstop.pde</a>, and <a class="el" href="Random_8pde-example.html#a2">Random.pde</a>.</dd>
</dl>
<p>References <a class="el" href="classAccelStepper.html#affbee789b5c19165846cf0409860ae79">computeNewSpeed()</a>.</p>
<p>Referenced by <a class="el" href="classAccelStepper.html#a68942c66e78fb7f7b5f0cdade6eb7f06">move()</a>, and <a class="el" href="classAccelStepper.html#a176c5d2e4c2f21e9e92b12e39a6f0e67">runToNewPosition()</a>.</p>
</div>
</div>
<a class="anchor" id="a608b2395b64ac15451d16d0371fe13ce"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">boolean AccelStepper::run </td>
<td>(</td>
<td class="paramname"></td><td>)</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 acheive the target position. You must call this as frequently as possible, but at least once per minimum step interval, preferably in your main loop. </p>
<dl class="section return"><dt>Returns</dt><dd>true if the motor is at the target position. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="Bounce_8pde-example.html#a6">Bounce.pde</a>, <a class="el" href="MultiStepper_8pde-example.html#a8">MultiStepper.pde</a>, <a class="el" href="Overshoot_8pde-example.html#a5">Overshoot.pde</a>, <a class="el" href="Quickstop_8pde-example.html#a5">Quickstop.pde</a>, and <a class="el" href="Random_8pde-example.html#a5">Random.pde</a>.</dd>
</dl>
<p>References <a class="el" href="classAccelStepper.html#affbee789b5c19165846cf0409860ae79">computeNewSpeed()</a>, and <a class="el" href="classAccelStepper.html#aa4a6bdf99f698284faaeb5542b0b7514">runSpeed()</a>.</p>
<p>Referenced by <a class="el" href="classAccelStepper.html#a344f58fef8cc34ac5aa75ba4b665d21c">runToPosition()</a>.</p>
</div>
</div>
<a class="anchor" id="aa4a6bdf99f698284faaeb5542b0b7514"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">boolean AccelStepper::runSpeed </td>
<td>(</td>
<td class="paramname"></td><td>)</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#ae79c49ad69d5ccc9da0ee691fa4ca235">setSpeed()</a>. You must call this as frequently as possible, but at least once per step interval, </p>
<dl class="section return"><dt>Returns</dt><dd>true if the motor was stepped. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="ConstantSpeed_8pde-example.html#a3">ConstantSpeed.pde</a>.</dd>
</dl>
<p>References <a class="el" href="classAccelStepper.html#a7468f91a925c689c3ba250f8d074d228ad604e0047f7cb47662c5a1cf6999337c">DIRECTION_CW</a>, and <a class="el" href="classAccelStepper.html#a8a419121702399d8ac66df4cc47481f4">step()</a>.</p>
<p>Referenced by <a class="el" href="classAccelStepper.html#a608b2395b64ac15451d16d0371fe13ce">run()</a>, and <a class="el" href="classAccelStepper.html#a9270d20336e76ac1fd5bcd5b9c34f301">runSpeedToPosition()</a>.</p>
</div>
</div>
<a class="anchor" id="a9270d20336e76ac1fd5bcd5b9c34f301"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">boolean AccelStepper::runSpeedToPosition </td>
<td>(</td>
<td class="paramname"></td><td>)</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>
<dl class="section return"><dt>Returns</dt><dd>true if it stepped </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="ProportionalControl_8pde-example.html#a4">ProportionalControl.pde</a>.</dd>
</dl>
<p>References <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>
</div>
</div>
<a class="anchor" id="a176c5d2e4c2f21e9e92b12e39a6f0e67"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::runToNewPosition </td>
<td>(</td>
<td class="paramtype">long&#160;</td>
<td class="paramname"><em>position</em></td><td>)</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. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">position</td><td>The new target position. </td></tr>
</table>
</dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="Blocking_8pde-example.html#a3">Blocking.pde</a>, and <a class="el" href="Overshoot_8pde-example.html#a6">Overshoot.pde</a>.</dd>
</dl>
<p>References <a class="el" href="classAccelStepper.html#ace236ede35f87c63d18da25810ec9736">moveTo()</a>, and <a class="el" href="classAccelStepper.html#a344f58fef8cc34ac5aa75ba4b665d21c">runToPosition()</a>.</p>
</div>
</div>
<a class="anchor" id="a344f58fef8cc34ac5aa75ba4b665d21c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::runToPosition </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Moves the motor at the currently selected constant speed (forward or reverse) to the target position and blocks until it is at position. Dont use this in event loops, since it blocks. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="Quickstop_8pde-example.html#a7">Quickstop.pde</a>.</dd>
</dl>
<p>References <a class="el" href="classAccelStepper.html#a748665c3962e66fbc0e9373eb14c69c1">distanceToGo()</a>, and <a class="el" href="classAccelStepper.html#a608b2395b64ac15451d16d0371fe13ce">run()</a>.</p>
<p>Referenced by <a class="el" href="classAccelStepper.html#a176c5d2e4c2f21e9e92b12e39a6f0e67">runToNewPosition()</a>.</p>
</div>
</div>
<a class="anchor" id="adfb19e3cd2a028a1fe78131787604fd1"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::setAcceleration </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>acceleration</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the acceleration and deceleration parameter. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">acceleration</td><td>The desired acceleration in steps per second per second. Must be &gt; 0.0. This is an expensive call since it requires a square root to be calculated. Dont call more ofthen than needed </td></tr>
</table>
</dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="Blocking_8pde-example.html#a2">Blocking.pde</a>, <a class="el" href="Bounce_8pde-example.html#a2">Bounce.pde</a>, <a class="el" href="MultiStepper_8pde-example.html#a4">MultiStepper.pde</a>, <a class="el" href="Overshoot_8pde-example.html#a2">Overshoot.pde</a>, <a class="el" href="Quickstop_8pde-example.html#a2">Quickstop.pde</a>, and <a class="el" href="Random_8pde-example.html#a4">Random.pde</a>.</dd>
</dl>
<p>References <a class="el" href="classAccelStepper.html#affbee789b5c19165846cf0409860ae79">computeNewSpeed()</a>.</p>
</div>
</div>
<a class="anchor" id="a9d917f014317fb9d3b5dc14e66f6c689"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::setCurrentPosition </td>
<td>(</td>
<td class="paramtype">long&#160;</td>
<td class="paramname"><em>position</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Resets the current position of the motor, so that wherever the motor happens to be right now is considered to be the new 0 position. Useful for setting a zero position on a stepper after an initial hardware positioning move. Has the side effect of setting the current motor speed to 0. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">position</td><td>The position in steps of wherever the motor happens to be right now. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a56a81c5f00d02ca19646718e88e974c0"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::setEnablePin </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>enablePin</em> = <code>0xff</code></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the enable pin number for stepper drivers. 0xFF indicates unused (default). Otherwise, if a pin is set, the pin will be turned on when <a class="el" href="classAccelStepper.html#aa279a50d30d0413f570c692cff071643">enableOutputs()</a> is called and switched off when <a class="el" href="classAccelStepper.html#a3591e29a236e2935afd7f64ff6c22006">disableOutputs()</a> is called. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">enablePin</td><td>Arduino digital pin number for motor enable </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classAccelStepper.html#ac62cae590c2f9c303519a3a1c4adc8ab">setPinsInverted</a> </dd></dl>
</div>
</div>
<a class="anchor" id="abee8d466229b87accba33d6ec929c18f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::setMaxSpeed </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>speed</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the maximum permitted speed. the <a class="el" href="classAccelStepper.html#a608b2395b64ac15451d16d0371fe13ce">run()</a> function will accelerate up to the speed set by this function. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">speed</td><td>The desired maximum speed in steps per second. Must be &gt; 0. Caution: Speeds that exceed the maximum speed supported by the processor may Result in non-linear accelerations and decelerations. </td></tr>
</table>
</dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="Blocking_8pde-example.html#a1">Blocking.pde</a>, <a class="el" href="Bounce_8pde-example.html#a1">Bounce.pde</a>, <a class="el" href="ConstantSpeed_8pde-example.html#a1">ConstantSpeed.pde</a>, <a class="el" href="MultiStepper_8pde-example.html#a3">MultiStepper.pde</a>, <a class="el" href="Overshoot_8pde-example.html#a1">Overshoot.pde</a>, <a class="el" href="ProportionalControl_8pde-example.html#a1">ProportionalControl.pde</a>, <a class="el" href="Quickstop_8pde-example.html#a1">Quickstop.pde</a>, and <a class="el" href="Random_8pde-example.html#a3">Random.pde</a>.</dd>
</dl>
<p>References <a class="el" href="classAccelStepper.html#affbee789b5c19165846cf0409860ae79">computeNewSpeed()</a>, and <a class="el" href="classAccelStepper.html#a4f0989d0ae264e7eadfe1fa720769fb6">speed()</a>.</p>
</div>
</div>
<a class="anchor" id="af4d3818e691dad5dc518308796ccf154"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::setMinPulseWidth </td>
<td>(</td>
<td class="paramtype">unsigned int&#160;</td>
<td class="paramname"><em>minWidth</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the minimum pulse width allowed by the stepper driver. The minimum practical pulse width is approximately 20 microseconds. Times less than 20 microseconds will usually result in 20 microseconds or so. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">minWidth</td><td>The minimum pulse width in microseconds. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="af3c2516b6ce7c1ecbc2004107bb2a9ce"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::setOutputPins </td>
<td>(</td>
<td class="paramtype">uint8_t&#160;</td>
<td class="paramname"><em>mask</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Low level function to set the motor output pins bit 0 of the mask corresponds to _pin[0] bit 1 of the mask corresponds to _pin[1] You can override this to impment, for example serial chip output insted of using the output pins directly </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="MotorShield_8pde-example.html#a2">MotorShield.pde</a>.</dd>
</dl>
<p>References <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5adedd394a375190a3df8d4519c0d4dc2f">FULL4WIRE</a>, and <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5aecc0900c55b777d2e885581b8c434b07">HALF4WIRE</a>.</p>
<p>Referenced by <a class="el" href="classAccelStepper.html#a3591e29a236e2935afd7f64ff6c22006">disableOutputs()</a>, <a class="el" href="classAccelStepper.html#a63ef416bc039da539294e84a41e7d7dc">step1()</a>, <a class="el" href="classAccelStepper.html#a674e48a6bf99e7ad1f013c1e4414565a">step2()</a>, <a class="el" href="classAccelStepper.html#ad73c61aade2e10243dfb02aefa7ab8fd">step3()</a>, <a class="el" href="classAccelStepper.html#a8910bd9218a54dfb7e2372a6d0bcca0c">step4()</a>, <a class="el" href="classAccelStepper.html#a4b0faf1ebc0c584ab606c0c0f66986b0">step6()</a>, and <a class="el" href="classAccelStepper.html#aa909c6c3fcd3ea4b3ee1aa8b4d0f7e87">step8()</a>.</p>
</div>
</div>
<a class="anchor" id="ac62cae590c2f9c303519a3a1c4adc8ab"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::setPinsInverted </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>directionInvert</em> = <code>false</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>stepInvert</em> = <code>false</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>enableInvert</em> = <code>false</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the inversion for stepper driver pins </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">directionInvert</td><td>True for inverted direction pin, false for non-inverted </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">stepInvert</td><td>True for inverted step pin, false for non-inverted </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">enableInvert</td><td>True for inverted enable pin, false (default) for non-inverted </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a38298ac2dd852fb22259f6c4bbe08c94"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::setPinsInverted </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>pin1Invert</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>pin2Invert</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>pin3Invert</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>pin4Invert</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>enableInvert</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the inversion for 2, 3 and 4 wire stepper pins </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">pin1Invert</td><td>True for inverted pin1, false for non-inverted </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">pin2Invert</td><td>True for inverted pin2, false for non-inverted </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">pin3Invert</td><td>True for inverted pin3, false for non-inverted </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">pin4Invert</td><td>True for inverted pin4, false for non-inverted </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">enableInvert</td><td>True for inverted enable pin, false (default) for non-inverted </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ae79c49ad69d5ccc9da0ee691fa4ca235"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::setSpeed </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>speed</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the desired constant speed for use with <a class="el" href="classAccelStepper.html#aa4a6bdf99f698284faaeb5542b0b7514">runSpeed()</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">speed</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#aa4a6bdf99f698284faaeb5542b0b7514">runSpeed()</a> function. </td></tr>
</table>
</dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="ConstantSpeed_8pde-example.html#a2">ConstantSpeed.pde</a>, and <a class="el" href="ProportionalControl_8pde-example.html#a3">ProportionalControl.pde</a>.</dd>
</dl>
<p>References <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#a4f0989d0ae264e7eadfe1fa720769fb6">speed()</a>.</p>
</div>
</div>
<a class="anchor" id="a4f0989d0ae264e7eadfe1fa720769fb6"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">float AccelStepper::speed </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</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>Referenced by <a class="el" href="classAccelStepper.html#abee8d466229b87accba33d6ec929c18f">setMaxSpeed()</a>, and <a class="el" href="classAccelStepper.html#ae79c49ad69d5ccc9da0ee691fa4ca235">setSpeed()</a>.</p>
</div>
</div>
<a class="anchor" id="a8a419121702399d8ac66df4cc47481f4"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::step </td>
<td>(</td>
<td class="paramtype">long&#160;</td>
<td class="paramname"><em>step</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </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#a63ef416bc039da539294e84a41e7d7dc">step1()</a>, <a class="el" href="classAccelStepper.html#a674e48a6bf99e7ad1f013c1e4414565a">step2()</a>, <a class="el" href="classAccelStepper.html#a8910bd9218a54dfb7e2372a6d0bcca0c">step4()</a> or <a class="el" href="classAccelStepper.html#aa909c6c3fcd3ea4b3ee1aa8b4d0f7e87">step8()</a> depending on the number of pins defined for the stepper. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">step</td><td>The current step phase number (0 to 7) </td></tr>
</table>
</dd>
</dl>
<p>References <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5ac3523e4cf6763ba518d16fec3708ef23">DRIVER</a>, <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5a62a305b52f749ff8c89138273fbb012d">FULL2WIRE</a>, <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5a0b8eea5cf0f8ce70b1959d2977ccc996">FULL3WIRE</a>, <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5adedd394a375190a3df8d4519c0d4dc2f">FULL4WIRE</a>, <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5af5bb99ad9d67ad2d85f840e3abcfe068">FUNCTION</a>, <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5a00c2387a5af43d8e97639699ab7a5c7f">HALF3WIRE</a>, <a class="el" href="classAccelStepper.html#a73bdecf1273d98d8c5fbcb764cabeea5aecc0900c55b777d2e885581b8c434b07">HALF4WIRE</a>, <a class="el" href="classAccelStepper.html#aa2913db789e6fa05756579ff82fe6e7e">step0()</a>, <a class="el" href="classAccelStepper.html#a63ef416bc039da539294e84a41e7d7dc">step1()</a>, <a class="el" href="classAccelStepper.html#a674e48a6bf99e7ad1f013c1e4414565a">step2()</a>, <a class="el" href="classAccelStepper.html#ad73c61aade2e10243dfb02aefa7ab8fd">step3()</a>, <a class="el" href="classAccelStepper.html#a8910bd9218a54dfb7e2372a6d0bcca0c">step4()</a>, <a class="el" href="classAccelStepper.html#a4b0faf1ebc0c584ab606c0c0f66986b0">step6()</a>, and <a class="el" href="classAccelStepper.html#aa909c6c3fcd3ea4b3ee1aa8b4d0f7e87">step8()</a>.</p>
<p>Referenced by <a class="el" href="classAccelStepper.html#aa4a6bdf99f698284faaeb5542b0b7514">runSpeed()</a>.</p>
</div>
</div>
<a class="anchor" id="aa2913db789e6fa05756579ff82fe6e7e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::step0 </td>
<td>(</td>
<td class="paramtype">long&#160;</td>
<td class="paramname"><em>step</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>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 </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">step</td><td>The current step phase number (0 to 7) </td></tr>
</table>
</dd>
</dl>
<p>Referenced by <a class="el" href="classAccelStepper.html#a8a419121702399d8ac66df4cc47481f4">step()</a>.</p>
</div>
</div>
<a class="anchor" id="a63ef416bc039da539294e84a41e7d7dc"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::step1 </td>
<td>(</td>
<td class="paramtype">long&#160;</td>
<td class="paramname"><em>step</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Called to execute a step on a stepper driver (ie where pins == 1). Only called when a new step is required. Subclasses may override to implement new stepping interfaces. The default sets or clears the outputs of Step pin1 to step, and sets the output of _pin2 to the desired direction. The Step pin (_pin1) is pulsed for 1 microsecond which is the minimum STEP pulse width for the 3967 driver. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">step</td><td>The current step phase number (0 to 7) </td></tr>
</table>
</dd>
</dl>
<p>References <a class="el" href="classAccelStepper.html#af3c2516b6ce7c1ecbc2004107bb2a9ce">setOutputPins()</a>.</p>
<p>Referenced by <a class="el" href="classAccelStepper.html#a8a419121702399d8ac66df4cc47481f4">step()</a>.</p>
</div>
</div>
<a class="anchor" id="a674e48a6bf99e7ad1f013c1e4414565a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::step2 </td>
<td>(</td>
<td class="paramtype">long&#160;</td>
<td class="paramname"><em>step</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </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 </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">step</td><td>The current step phase number (0 to 7) </td></tr>
</table>
</dd>
</dl>
<p>References <a class="el" href="classAccelStepper.html#af3c2516b6ce7c1ecbc2004107bb2a9ce">setOutputPins()</a>.</p>
<p>Referenced by <a class="el" href="classAccelStepper.html#a8a419121702399d8ac66df4cc47481f4">step()</a>.</p>
</div>
</div>
<a class="anchor" id="ad73c61aade2e10243dfb02aefa7ab8fd"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::step3 </td>
<td>(</td>
<td class="paramtype">long&#160;</td>
<td class="paramname"><em>step</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Called to execute a step on a 3 pin motor, such as HDD spindle. Only called when a new step is required. Subclasses may override to implement new stepping interfaces. The default sets or clears the outputs of pin1, pin2, pin3 </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">step</td><td>The current step phase number (0 to 7) </td></tr>
</table>
</dd>
</dl>
<p>References <a class="el" href="classAccelStepper.html#af3c2516b6ce7c1ecbc2004107bb2a9ce">setOutputPins()</a>.</p>
<p>Referenced by <a class="el" href="classAccelStepper.html#a8a419121702399d8ac66df4cc47481f4">step()</a>.</p>
</div>
</div>
<a class="anchor" id="a8910bd9218a54dfb7e2372a6d0bcca0c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::step4 </td>
<td>(</td>
<td class="paramtype">long&#160;</td>
<td class="paramname"><em>step</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </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. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">step</td><td>The current step phase number (0 to 7) </td></tr>
</table>
</dd>
</dl>
<p>References <a class="el" href="classAccelStepper.html#af3c2516b6ce7c1ecbc2004107bb2a9ce">setOutputPins()</a>.</p>
<p>Referenced by <a class="el" href="classAccelStepper.html#a8a419121702399d8ac66df4cc47481f4">step()</a>.</p>
</div>
</div>
<a class="anchor" id="a4b0faf1ebc0c584ab606c0c0f66986b0"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::step6 </td>
<td>(</td>
<td class="paramtype">long&#160;</td>
<td class="paramname"><em>step</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Called to execute a step on a 3 pin motor, such as HDD spindle. Only called when a new step is required. Subclasses may override to implement new stepping interfaces. The default sets or clears the outputs of pin1, pin2, pin3 </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">step</td><td>The current step phase number (0 to 7) </td></tr>
</table>
</dd>
</dl>
<p>References <a class="el" href="classAccelStepper.html#af3c2516b6ce7c1ecbc2004107bb2a9ce">setOutputPins()</a>.</p>
<p>Referenced by <a class="el" href="classAccelStepper.html#a8a419121702399d8ac66df4cc47481f4">step()</a>.</p>
</div>
</div>
<a class="anchor" id="aa909c6c3fcd3ea4b3ee1aa8b4d0f7e87"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::step8 </td>
<td>(</td>
<td class="paramtype">long&#160;</td>
<td class="paramname"><em>step</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Called to execute a step on a 4 pin half-steper motor. Only called when a new step is required. Subclasses may override to implement new stepping interfaces. The default sets or clears the outputs of pin1, pin2, pin3, pin4. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">step</td><td>The current step phase number (0 to 7) </td></tr>
</table>
</dd>
</dl>
<p>References <a class="el" href="classAccelStepper.html#af3c2516b6ce7c1ecbc2004107bb2a9ce">setOutputPins()</a>.</p>
<p>Referenced by <a class="el" href="classAccelStepper.html#a8a419121702399d8ac66df4cc47481f4">step()</a>.</p>
</div>
</div>
<a class="anchor" id="a638817b85aed9d5cd15c76a76c00aced"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void AccelStepper::stop </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets a new target position that causes the stepper to stop as quickly as possible, using to the current speed and acceleration parameters. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="Quickstop_8pde-example.html#a6">Quickstop.pde</a>.</dd>
</dl>
<p>References <a class="el" href="classAccelStepper.html#a68942c66e78fb7f7b5f0cdade6eb7f06">move()</a>.</p>
</div>
</div>
<a class="anchor" id="a96685e0945b7cf75d5959da679cd911e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">long AccelStepper::targetPosition </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>The most recently set target position. </p>
<dl class="section return"><dt>Returns</dt><dd>the target position in steps. Positive is clockwise from the 0 position. </dd></dl>
</div>
</div>
<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>
<li>AccelStepper.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>
</body>
</html>