node-poweredup/docs/classes.list.html
Nathan Kellenicki 5ad9bc5748
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
Now supports PUP Hub firmware 1.1.00.0004 - rotation works on Boost tacho motor. Also manual setup of virtual ports.
2019-04-12 15:14:00 -07:00

6775 lines
78 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>node-poweredup Classes</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.simplex.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top navbar-inverse">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="index.html">node-poweredup</a>
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse" id="topNavigation">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="BoostMoveHub.html">BoostMoveHub</a></li><li><a href="DuploTrainBase.html">DuploTrainBase</a></li><li><a href="Hub.html">Hub</a></li><li><a href="LPF2Hub.html">LPF2Hub</a></li><li><a href="PoweredUP.html">PoweredUP</a></li><li><a href="PUPHub.html">PUPHub</a></li><li><a href="PUPRemote.html">PUPRemote</a></li><li><a href="WeDo2SmartHub.html">WeDo2SmartHub</a></li>
</ul>
</li>
<li class="dropdown">
<a href="events.list.html" class="dropdown-toggle" data-toggle="dropdown">Events<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="BoostMoveHub.html#event:attach">BoostMoveHub#event:attach</a></li><li><a href="BoostMoveHub.html#event:button">BoostMoveHub#event:button</a></li><li><a href="BoostMoveHub.html#event:color">BoostMoveHub#event:color</a></li><li><a href="BoostMoveHub.html#event:colorAndDistance">BoostMoveHub#event:colorAndDistance</a></li><li><a href="BoostMoveHub.html#event:detach">BoostMoveHub#event:detach</a></li><li><a href="BoostMoveHub.html#event:distance">BoostMoveHub#event:distance</a></li><li><a href="BoostMoveHub.html#event:rotate">BoostMoveHub#event:rotate</a></li><li><a href="BoostMoveHub.html#event:tilt">BoostMoveHub#event:tilt</a></li><li><a href="DuploTrainBase.html#event:color">DuploTrainBase#event:color</a></li><li><a href="DuploTrainBase.html#event:speed">DuploTrainBase#event:speed</a></li><li><a href="Hub.html#event:attach">Hub#event:attach</a></li><li><a href="Hub.html#event:detach">Hub#event:detach</a></li><li><a href="LPF2Hub.html#event:attach">LPF2Hub#event:attach</a></li><li><a href="LPF2Hub.html#event:button">LPF2Hub#event:button</a></li><li><a href="LPF2Hub.html#event:color">LPF2Hub#event:color</a></li><li><a href="LPF2Hub.html#event:colorAndDistance">LPF2Hub#event:colorAndDistance</a></li><li><a href="LPF2Hub.html#event:detach">LPF2Hub#event:detach</a></li><li><a href="LPF2Hub.html#event:distance">LPF2Hub#event:distance</a></li><li><a href="LPF2Hub.html#event:rotate">LPF2Hub#event:rotate</a></li><li><a href="LPF2Hub.html#event:speed">LPF2Hub#event:speed</a></li><li><a href="LPF2Hub.html#event:tilt">LPF2Hub#event:tilt</a></li><li><a href="PoweredUP.html#event:discover">PoweredUP#event:discover</a></li><li><a href="PUPHub.html#event:attach">PUPHub#event:attach</a></li><li><a href="PUPHub.html#event:button">PUPHub#event:button</a></li><li><a href="PUPHub.html#event:color">PUPHub#event:color</a></li><li><a href="PUPHub.html#event:colorAndDistance">PUPHub#event:colorAndDistance</a></li><li><a href="PUPHub.html#event:detach">PUPHub#event:detach</a></li><li><a href="PUPHub.html#event:distance">PUPHub#event:distance</a></li><li><a href="PUPHub.html#event:tilt">PUPHub#event:tilt</a></li><li><a href="PUPRemote.html#event:button">PUPRemote#event:button</a></li><li><a href="PUPRemote.html#event:colorAndDistance">PUPRemote#event:colorAndDistance</a></li><li><a href="WeDo2SmartHub.html#event:attach">WeDo2SmartHub#event:attach</a></li><li><a href="WeDo2SmartHub.html#event:button">WeDo2SmartHub#event:button</a></li><li><a href="WeDo2SmartHub.html#event:color">WeDo2SmartHub#event:color</a></li><li><a href="WeDo2SmartHub.html#event:detach">WeDo2SmartHub#event:detach</a></li><li><a href="WeDo2SmartHub.html#event:distance">WeDo2SmartHub#event:distance</a></li><li><a href="WeDo2SmartHub.html#event:rotate">WeDo2SmartHub#event:rotate</a></li><li><a href="WeDo2SmartHub.html#event:tilt">WeDo2SmartHub#event:tilt</a></li>
</ul>
</li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="global.html">Global</a></li>
</ul>
</li>
</ul>
<div class="col-sm-3 col-md-3">
<form class="navbar-form" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" name="q" id="search-input">
<div class="input-group-btn">
<button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="container" id="toc-content">
<div class="row">
<div class="col-md-8">
<div id="main">
<h1 class="page-title">Classes</h1>
<section>
<header>
<h2>
</h2>
</header>
<article>
<div class="container-overview">
<dl class="details">
</dl>
</div>
<h3 class="subsection-title">Classes</h3>
<dl>
<dt><a href="BoostMoveHub.html">BoostMoveHub</a></dt>
<dd></dd>
<dt><a href="DuploTrainBase.html">DuploTrainBase</a></dt>
<dd></dd>
<dt><a href="Hub.html">Hub</a></dt>
<dd></dd>
<dt><a href="LPF2Hub.html">LPF2Hub</a></dt>
<dd></dd>
<dt><a href="PoweredUP.html">PoweredUP</a></dt>
<dd></dd>
<dt><a href="PUPHub.html">PUPHub</a></dt>
<dd></dd>
<dt><a href="PUPRemote.html">PUPRemote</a></dt>
<dd></dd>
<dt><a href="WeDo2SmartHub.html">WeDo2SmartHub</a></dt>
<dd></dd>
</dl>
<h3 class="subsection-title">Events</h3>
<dl>
<hr>
<dt>
<h4 class="name" id="event:attach">attach</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a motor or sensor is attached to the Hub.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type"><a href="global.html#DeviceType">DeviceType</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="Hub.html#event:attach">Hub#event:attach</a>
</li>
</ul>
</dd>
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="Hub.html#event:attach">Hub#event:attach</a>
</li></ul></dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="hub.js.html">hub.js</a>,
<a href="hub.js.html#sunlight-1-line-217">line 217</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:button">button</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a button is pressed.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>button</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>state</code></td>
<td class="type">
<span class="param-type"><a href="global.html#ButtonState">ButtonState</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="LPF2Hub.html#event:button">LPF2Hub#event:button</a>
</li>
</ul>
</dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-184">line 184</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:color">color</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a color sensor is activated.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>color</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Color">Color</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="LPF2Hub.html#event:color">LPF2Hub#event:color</a>
</li>
</ul>
</dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-306">line 306</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:colorAndDistance">colorAndDistance</h4>
</dt>
<dd>
<div class="description">
<p>A combined color and distance event, emits when the sensor is activated.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>color</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Color">Color</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>distance</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Distance, in millimeters.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="LPF2Hub.html#event:colorAndDistance">LPF2Hub#event:colorAndDistance</a>
</li>
</ul>
</dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-322">line 322</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:detach">detach</h4>
</dt>
<dd>
<div class="description">
<p>Emits when an attached motor or sensor is detached from the Hub.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="Hub.html#event:detach">Hub#event:detach</a>
</li>
</ul>
</dd>
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="Hub.html#event:detach">Hub#event:detach</a>
</li></ul></dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="hub.js.html">hub.js</a>,
<a href="hub.js.html#sunlight-1-line-229">line 229</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:distance">distance</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a distance sensor is activated.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>distance</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Distance, in millimeters.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="LPF2Hub.html#event:distance">LPF2Hub#event:distance</a>
</li>
</ul>
</dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-296">line 296</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:rotate">rotate</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a rotation sensor is activated.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>rotation</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="LPF2Hub.html#event:rotate">LPF2Hub#event:rotate</a>
</li>
</ul>
</dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-351">line 351</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:tilt">tilt</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a tilt sensor is activated.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>If the event is fired from the Move Hub's in-built tilt sensor, the special port &quot;TILT&quot; is used.</p></td>
</tr>
<tr>
<td class="name"><code>x</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="LPF2Hub.html#event:tilt">LPF2Hub#event:tilt</a>
</li>
</ul>
</dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-339">line 339</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:color">color</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a color sensor is activated.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>color</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Color">Color</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="LPF2Hub.html#event:color">LPF2Hub#event:color</a>
</li>
</ul>
</dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-306">line 306</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:speed">speed</h4>
</dt>
<dd>
<div class="description">
<p>Emits on a speed change.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>speed</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="LPF2Hub.html#event:speed">LPF2Hub#event:speed</a>
</li>
</ul>
</dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-399">line 399</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:attach">attach</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a motor or sensor is attached to the Hub.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type"><a href="global.html#DeviceType">DeviceType</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="hub.js.html">hub.js</a>,
<a href="hub.js.html#sunlight-1-line-217">line 217</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:detach">detach</h4>
</dt>
<dd>
<div class="description">
<p>Emits when an attached motor or sensor is detached from the Hub.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="hub.js.html">hub.js</a>,
<a href="hub.js.html#sunlight-1-line-229">line 229</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:attach">attach</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a motor or sensor is attached to the Hub.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type"><a href="global.html#DeviceType">DeviceType</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="Hub.html#event:attach">Hub#event:attach</a>
</li>
</ul>
</dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="hub.js.html">hub.js</a>,
<a href="hub.js.html#sunlight-1-line-217">line 217</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:button">button</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a button is pressed.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>button</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>state</code></td>
<td class="type">
<span class="param-type"><a href="global.html#ButtonState">ButtonState</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-184">line 184</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:color">color</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a color sensor is activated.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>color</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Color">Color</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-306">line 306</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:colorAndDistance">colorAndDistance</h4>
</dt>
<dd>
<div class="description">
<p>A combined color and distance event, emits when the sensor is activated.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>color</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Color">Color</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>distance</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Distance, in millimeters.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-322">line 322</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:detach">detach</h4>
</dt>
<dd>
<div class="description">
<p>Emits when an attached motor or sensor is detached from the Hub.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="Hub.html#event:detach">Hub#event:detach</a>
</li>
</ul>
</dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="hub.js.html">hub.js</a>,
<a href="hub.js.html#sunlight-1-line-229">line 229</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:distance">distance</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a distance sensor is activated.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>distance</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Distance, in millimeters.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-296">line 296</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:rotate">rotate</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a rotation sensor is activated.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>rotation</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-351">line 351</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:speed">speed</h4>
</dt>
<dd>
<div class="description">
<p>Emits on a speed change.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>speed</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-399">line 399</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:tilt">tilt</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a tilt sensor is activated.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>If the event is fired from the Move Hub's in-built tilt sensor, the special port &quot;TILT&quot; is used.</p></td>
</tr>
<tr>
<td class="name"><code>x</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-339">line 339</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:discover">discover</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a Powered UP Hub device is found.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>hub</code></td>
<td class="type">
<span class="param-type"><a href="WeDo2SmartHub.html">WeDo2SmartHub</a></span>
|
<span class="param-type"><a href="BoostMoveHub.html">BoostMoveHub</a></span>
|
<span class="param-type"><a href="PUPHub.html">PUPHub</a></span>
|
<span class="param-type"><a href="PUPRemote.html">PUPRemote</a></span>
|
<span class="param-type"><a href="DuploTrainBase.html">DuploTrainBase</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="poweredup-node.js.html">poweredup-node.js</a>,
<a href="poweredup-node.js.html#sunlight-1-line-131">line 131</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:attach">attach</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a motor or sensor is attached to the Hub.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type"><a href="global.html#DeviceType">DeviceType</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="Hub.html#event:attach">Hub#event:attach</a>
</li>
</ul>
</dd>
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="Hub.html#event:attach">Hub#event:attach</a>
</li></ul></dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="hub.js.html">hub.js</a>,
<a href="hub.js.html#sunlight-1-line-217">line 217</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:button">button</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a button is pressed.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>button</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>state</code></td>
<td class="type">
<span class="param-type"><a href="global.html#ButtonState">ButtonState</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="LPF2Hub.html#event:button">LPF2Hub#event:button</a>
</li>
</ul>
</dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-184">line 184</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:color">color</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a color sensor is activated.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>color</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Color">Color</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="LPF2Hub.html#event:color">LPF2Hub#event:color</a>
</li>
</ul>
</dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-306">line 306</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:colorAndDistance">colorAndDistance</h4>
</dt>
<dd>
<div class="description">
<p>A combined color and distance event, emits when the sensor is activated.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>color</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Color">Color</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>distance</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Distance, in millimeters.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="LPF2Hub.html#event:colorAndDistance">LPF2Hub#event:colorAndDistance</a>
</li>
</ul>
</dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-322">line 322</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:detach">detach</h4>
</dt>
<dd>
<div class="description">
<p>Emits when an attached motor or sensor is detached from the Hub.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="Hub.html#event:detach">Hub#event:detach</a>
</li>
</ul>
</dd>
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="Hub.html#event:detach">Hub#event:detach</a>
</li></ul></dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="hub.js.html">hub.js</a>,
<a href="hub.js.html#sunlight-1-line-229">line 229</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:distance">distance</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a distance sensor is activated.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>distance</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Distance, in millimeters.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="LPF2Hub.html#event:distance">LPF2Hub#event:distance</a>
</li>
</ul>
</dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-296">line 296</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:tilt">tilt</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a tilt sensor is activated.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>If the event is fired from the Move Hub's in-built tilt sensor, the special port &quot;TILT&quot; is used.</p></td>
</tr>
<tr>
<td class="name"><code>x</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="LPF2Hub.html#event:tilt">LPF2Hub#event:tilt</a>
</li>
</ul>
</dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-339">line 339</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:button">button</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a button is pressed.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>button</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>state</code></td>
<td class="type">
<span class="param-type"><a href="global.html#ButtonState">ButtonState</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="LPF2Hub.html#event:button">LPF2Hub#event:button</a>
</li>
</ul>
</dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-184">line 184</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:colorAndDistance">colorAndDistance</h4>
</dt>
<dd>
<div class="description">
<p>A combined color and distance event, emits when the sensor is activated.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>color</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Color">Color</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>distance</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Distance, in millimeters.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="LPF2Hub.html#event:colorAndDistance">LPF2Hub#event:colorAndDistance</a>
</li>
</ul>
</dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="lpf2hub.js.html">lpf2hub.js</a>,
<a href="lpf2hub.js.html#sunlight-1-line-322">line 322</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:attach">attach</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a motor or sensor is attached to the Hub.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type"><a href="global.html#DeviceType">DeviceType</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="Hub.html#event:attach">Hub#event:attach</a>
</li>
</ul>
</dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="hub.js.html">hub.js</a>,
<a href="hub.js.html#sunlight-1-line-217">line 217</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:button">button</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a button is pressed.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>button</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>state</code></td>
<td class="type">
<span class="param-type"><a href="global.html#ButtonState">ButtonState</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="wedo2smarthub.js.html">wedo2smarthub.js</a>,
<a href="wedo2smarthub.js.html#sunlight-1-line-324">line 324</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:color">color</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a color sensor is activated.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>color</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Color">Color</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="wedo2smarthub.js.html">wedo2smarthub.js</a>,
<a href="wedo2smarthub.js.html#sunlight-1-line-369">line 369</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:detach">detach</h4>
</dt>
<dd>
<div class="description">
<p>Emits when an attached motor or sensor is detached from the Hub.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from method-doc-label method-doc-details-label">Inherited From:</dt>
<dd class="inherited-from">
<ul class="dummy">
<li>
<a href="Hub.html#event:detach">Hub#event:detach</a>
</li>
</ul>
</dd>
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="hub.js.html">hub.js</a>,
<a href="hub.js.html#sunlight-1-line-229">line 229</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:distance">distance</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a distance sensor is activated.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>distance</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Distance, in millimeters.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="wedo2smarthub.js.html">wedo2smarthub.js</a>,
<a href="wedo2smarthub.js.html#sunlight-1-line-358">line 358</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:rotate">rotate</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a rotation sensor is activated.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>rotation</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="wedo2smarthub.js.html">wedo2smarthub.js</a>,
<a href="wedo2smarthub.js.html#sunlight-1-line-399">line 399</a>
</li>
</ul>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="event:tilt">tilt</h4>
</dt>
<dd>
<div class="description">
<p>Emits when a tilt sensor is activated.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>port</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>x</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="wedo2smarthub.js.html">wedo2smarthub.js</a>,
<a href="wedo2smarthub.js.html#sunlight-1-line-387">line 387</a>
</li>
</ul>
</dd>
</dl>
</dd>
</dl>
</article>
</section>
</div>
</div>
<div class="clearfix"></div>
<div class="col-md-3">
<div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div>
</div>
</div>
</div>
<div class="modal fade" id="searchResults">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">Search results</h4>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<footer>
<span class="copyright">
node-poweredup by Nathan Kellenicki licensed under the MIT license.
</span>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
on Fri Apr 12th 2019
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
</footer>
<script src="scripts/docstrap.lib.js"></script>
<script src="scripts/toc.js"></script>
<script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
<script>
$( function () {
$( "[id*='$']" ).each( function () {
var $this = $( this );
$this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
} );
$( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
var $this = $( this );
var example = $this.find( "code" );
exampleText = example.html();
var lang = /{@lang (.*?)}/.exec( exampleText );
if ( lang && lang[1] ) {
exampleText = exampleText.replace( lang[0], "" );
example.html( exampleText );
lang = lang[1];
} else {
var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
lang = langClassMatch ? langClassMatch[1] : "javascript";
}
if ( lang ) {
$this
.addClass( "sunlight-highlight-" + lang )
.addClass( "linenums" )
.html( example.html() );
}
} );
Sunlight.highlightAll( {
lineNumbers : true,
showMenu : true,
enableDoclinks : true
} );
$.catchAnchorLinks( {
navbarOffset: 10
} );
$( "#toc" ).toc( {
anchorName : function ( i, heading, prefix ) {
return $( heading ).attr( "id" ) || ( prefix + i );
},
selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
showAndHide : false,
smoothScrolling: true
} );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
$( '.dropdown-toggle' ).dropdown();
$( "table" ).each( function () {
var $this = $( this );
$this.addClass('table');
} );
} );
</script>
<!--Navigation and Symbol Display-->
<!--Google Analytics-->
<script type="text/javascript">
$(document).ready(function() {
SearcherDisplay.init();
});
</script>
</body>
</html>