FtcRobotController/javadoc/org/firstinspires/ftc/teamcode/API.Motor.html
2022-02-15 17:09:58 -06:00

550 lines
19 KiB
HTML

<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (11.0.10) on Tue Feb 15 17:09:18 CST 2022 -->
<title>API.Motor</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="dc.created" content="2022-02-15">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../jquery/jquery-3.5.1.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="API.Motor";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.firstinspires.ftc.teamcode</a></div>
<h2 title="Class API.Motor" class="title">Class API.Motor</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.firstinspires.ftc.teamcode.API.Motor</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Enclosing class:</dt>
<dd><a href="API.html" title="class in org.firstinspires.ftc.teamcode">API</a></dd>
</dl>
<hr>
<pre>public class <span class="typeNameLabel">API.Motor</span>
extends java.lang.Object</pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#controlWithOneButton(boolean)">controlWithOneButton</a></span>&#8203;(boolean&nbsp;positiveControl)</code></th>
<td class="colLast">
<div class="block">Moves the motor forward at maximum speed if the button is pressed.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#controlWithOneButton(boolean,double)">controlWithOneButton</a></span>&#8203;(boolean&nbsp;positiveControl,
double&nbsp;speed)</code></th>
<td class="colLast">
<div class="block">Moves the motor forward at the provided speed if the button is pressed.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#controlWithTwoButtons(boolean,boolean)">controlWithTwoButtons</a></span>&#8203;(boolean&nbsp;positiveControl,
boolean&nbsp;negativeControl)</code></th>
<td class="colLast">
<div class="block">Moves the motor forward or backward at maximum speed based on the button inputs</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#controlWithTwoButtons(boolean,boolean,double)">controlWithTwoButtons</a></span>&#8203;(boolean&nbsp;positiveControl,
boolean&nbsp;negativeControl,
double&nbsp;speed)</code></th>
<td class="colLast">
<div class="block">Moves the motor forward or backward at the provided speed based on the button inputs</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>double</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPower()">getPower</a></span>()</code></th>
<td class="colLast">
<div class="block">Gets the previously set power</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>double</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getRawPower()">getRawPower</a></span>()</code></th>
<td class="colLast">
<div class="block">Gets the power the motor is currently moving at, or 0 if not moving</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#resetEncoder()">resetEncoder</a></span>()</code></th>
<td class="colLast">
<div class="block">Stops and resets the encoder</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setBehaviour(org.firstinspires.ftc.teamcode.API.MotorBehaviour)">setBehaviour</a></span>&#8203;(<a href="API.MotorBehaviour.html" title="enum in org.firstinspires.ftc.teamcode">API.MotorBehaviour</a>&nbsp;behaviour)</code></th>
<td class="colLast">
<div class="block">Set the zero-power behaviour of the motor.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setDirection(org.firstinspires.ftc.teamcode.API.Direction)">setDirection</a></span>&#8203;(<a href="API.Direction.html" title="enum in org.firstinspires.ftc.teamcode">API.Direction</a>&nbsp;direction)</code></th>
<td class="colLast">
<div class="block">Sets the direction the motor should move in, without starting the motor</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setDirection(org.firstinspires.ftc.teamcode.API.Direction,boolean)">setDirection</a></span>&#8203;(<a href="API.Direction.html" title="enum in org.firstinspires.ftc.teamcode">API.Direction</a>&nbsp;direction,
boolean&nbsp;immediate)</code></th>
<td class="colLast">
<div class="block">Sets the direction the motor should move in</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setPower(double)">setPower</a></span>&#8203;(double&nbsp;power)</code></th>
<td class="colLast">
<div class="block">Sets the power without starting the motor</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#start()">start</a></span>()</code></th>
<td class="colLast">
<div class="block">Starts the motor with the previously set power</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#start(double)">start</a></span>&#8203;(double&nbsp;power)</code></th>
<td class="colLast">
<div class="block">Starts the motor with the specified power</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#stop()">stop</a></span>()</code></th>
<td class="colLast">
<div class="block">Stops the motor</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="start()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>start</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;start()</pre>
<div class="block">Starts the motor with the previously set power</div>
</li>
</ul>
<a id="start(double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>start</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;start&#8203;(double&nbsp;power)</pre>
<div class="block">Starts the motor with the specified power</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>power</code> - the power to use for the motor</dd>
</dl>
</li>
</ul>
<a id="stop()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>stop</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;stop()</pre>
<div class="block">Stops the motor</div>
</li>
</ul>
<a id="setPower(double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPower</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setPower&#8203;(double&nbsp;power)</pre>
<div class="block">Sets the power without starting the motor</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>power</code> - the power to use for the motor</dd>
</dl>
</li>
</ul>
<a id="getPower()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPower</h4>
<pre class="methodSignature">public&nbsp;double&nbsp;getPower()</pre>
<div class="block">Gets the previously set power</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the power</dd>
</dl>
</li>
</ul>
<a id="getRawPower()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRawPower</h4>
<pre class="methodSignature">public&nbsp;double&nbsp;getRawPower()</pre>
<div class="block">Gets the power the motor is currently moving at, or 0 if not moving</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the power</dd>
</dl>
</li>
</ul>
<a id="setDirection(org.firstinspires.ftc.teamcode.API.Direction)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setDirection</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setDirection&#8203;(<a href="API.Direction.html" title="enum in org.firstinspires.ftc.teamcode">API.Direction</a>&nbsp;direction)</pre>
<div class="block">Sets the direction the motor should move in, without starting the motor</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>direction</code> - the direction to use for the motor</dd>
</dl>
</li>
</ul>
<a id="setDirection(org.firstinspires.ftc.teamcode.API.Direction,boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setDirection</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setDirection&#8203;(<a href="API.Direction.html" title="enum in org.firstinspires.ftc.teamcode">API.Direction</a>&nbsp;direction,
boolean&nbsp;immediate)</pre>
<div class="block">Sets the direction the motor should move in</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>direction</code> - the direction to use for the motor</dd>
<dd><code>immediate</code> - whether to immediately start the motor with the new direction</dd>
</dl>
</li>
</ul>
<a id="resetEncoder()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resetEncoder</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;resetEncoder()</pre>
<div class="block">Stops and resets the encoder</div>
</li>
</ul>
<a id="setBehaviour(org.firstinspires.ftc.teamcode.API.MotorBehaviour)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setBehaviour</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setBehaviour&#8203;(<a href="API.MotorBehaviour.html" title="enum in org.firstinspires.ftc.teamcode">API.MotorBehaviour</a>&nbsp;behaviour)</pre>
<div class="block">Set the zero-power behaviour of the motor.
BRAKE means to immediately apply brakes when power is 0, and FLOAT means to come to a rolling stop.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>behaviour</code> - the behaviour to use</dd>
</dl>
</li>
</ul>
<a id="controlWithTwoButtons(boolean,boolean,double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>controlWithTwoButtons</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;controlWithTwoButtons&#8203;(boolean&nbsp;positiveControl,
boolean&nbsp;negativeControl,
double&nbsp;speed)</pre>
<div class="block">Moves the motor forward or backward at the provided speed based on the button inputs</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>positiveControl</code> - the button used to move the motor forward</dd>
<dd><code>negativeControl</code> - the button used to move the motor backward</dd>
</dl>
</li>
</ul>
<a id="controlWithTwoButtons(boolean,boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>controlWithTwoButtons</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;controlWithTwoButtons&#8203;(boolean&nbsp;positiveControl,
boolean&nbsp;negativeControl)</pre>
<div class="block">Moves the motor forward or backward at maximum speed based on the button inputs</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>positiveControl</code> - the button used to move the motor forward</dd>
<dd><code>negativeControl</code> - the button used to move the motor backward</dd>
</dl>
</li>
</ul>
<a id="controlWithOneButton(boolean,double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>controlWithOneButton</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;controlWithOneButton&#8203;(boolean&nbsp;positiveControl,
double&nbsp;speed)</pre>
<div class="block">Moves the motor forward at the provided speed if the button is pressed.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>positiveControl</code> - the button used to move forward</dd>
</dl>
</li>
</ul>
<a id="controlWithOneButton(boolean)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>controlWithOneButton</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;controlWithOneButton&#8203;(boolean&nbsp;positiveControl)</pre>
<div class="block">Moves the motor forward at maximum speed if the button is pressed.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>positiveControl</code> - the button used to move forward</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
</footer>
</body>
</html>