node-poweredup/docs/TechnicColorSensor.html
Nathan Kellenicki abecb5385b
Some checks failed
continuous-integration/drone/push Build is failing
Updated
2024-04-25 16:38:57 -07:00

1525 lines
24 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: TechnicColorSensor</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: TechnicColorSensor</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>TechnicColorSensor<span class="signature">()</span><span class="type-signature"></span></h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="TechnicColorSensor"><span class="type-signature"></span>new TechnicColorSensor<span class="signature">()</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="devices_techniccolorsensor.js.html">devices/techniccolorsensor.js</a>, <a href="devices_techniccolorsensor.js.html#line30">line 30</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Extends</h3>
<ul>
<li><a href="Device.html">Device</a></li>
</ul>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="connected"><span class="type-signature">(readonly) </span>connected<span class="type-signature"></span></h4>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>connected</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>Check if the device is still attached.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Device.html#connected">Device#connected</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="devices_device.js.html">devices/device.js</a>, <a href="devices_device.js.html#line80">line 80</a>
</li></ul></dd>
</dl>
<h4 class="name" id="hub"><span class="type-signature">(readonly) </span>hub<span class="type-signature"></span></h4>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<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="Hub.html">Hub</a></span>
</td>
<td class="description last"><p>The Hub the device is attached to.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Device.html#hub">Device#hub</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="devices_device.js.html">devices/device.js</a>, <a href="devices_device.js.html#line87">line 87</a>
</li></ul></dd>
</dl>
<h4 class="name" id="isVirtualPort"><span class="type-signature">(readonly) </span>isVirtualPort<span class="type-signature"></span></h4>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>isVirtualPort</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>Is this device attached to a virtual port (ie. a combined device)</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Device.html#isVirtualPort">Device#isVirtualPort</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="devices_device.js.html">devices/device.js</a>, <a href="devices_device.js.html#line124">line 124</a>
</li></ul></dd>
</dl>
<h4 class="name" id="mode"><span class="type-signature">(readonly) </span>mode<span class="type-signature"></span></h4>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>mode</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The mode the device is currently in</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Device.html#mode">Device#mode</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="devices_device.js.html">devices/device.js</a>, <a href="devices_device.js.html#line114">line 114</a>
</li></ul></dd>
</dl>
<h4 class="name" id="portName"><span class="type-signature">(readonly) </span>portName<span class="type-signature"></span></h4>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>portName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>The port the device is attached to.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Device.html#portName">Device#portName</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="devices_device.js.html">devices/device.js</a>, <a href="devices_device.js.html#line97">line 97</a>
</li></ul></dd>
</dl>
<h4 class="name" id="type"><span class="type-signature">(readonly) </span>type<span class="type-signature"></span></h4>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>The type of the device</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Device.html#type">Device#type</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="devices_device.js.html">devices/device.js</a>, <a href="devices_device.js.html#line104">line 104</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="setBrightness"><span class="type-signature"></span>setBrightness<span class="signature">(firstSegment, secondSegment, thirdSegment)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
<div class="description">
<p>Set the brightness (or turn on/off) of the lights around the sensor.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>firstSegment</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>First light segment. 0-100 brightness.</p></td>
</tr>
<tr>
<td class="name"><code>secondSegment</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Second light segment. 0-100 brightness.</p></td>
</tr>
<tr>
<td class="name"><code>thirdSegment</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Third light segment. 0-100 brightness.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="devices_techniccolorsensor.js.html">devices/techniccolorsensor.js</a>, <a href="devices_techniccolorsensor.js.html#line75">line 75</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Resolved upon successful issuance of the command.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h3 class="subsection-title">Events</h3>
<h4 class="name" id="event:ambient">ambient</h4>
<div class="description">
<p>Emits when the ambient light changes.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>ambient</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Percentage, from 0 to 100.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="devices_techniccolorsensor.js.html">devices/techniccolorsensor.js</a>, <a href="devices_techniccolorsensor.js.html#line65">line 65</a>
</li></ul></dd>
</dl>
<h4 class="name" id="event:color">color</h4>
<div class="description">
<p>Emits when a color sensor is activated.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<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">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="devices_techniccolorsensor.js.html">devices/techniccolorsensor.js</a>, <a href="devices_techniccolorsensor.js.html#line44">line 44</a>
</li></ul></dd>
</dl>
<h4 class="name" id="event:reflect">reflect</h4>
<div class="description">
<p>Emits when the light reflectivity changes.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>reflect</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Percentage, from 0 to 100.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="devices_techniccolorsensor.js.html">devices/techniccolorsensor.js</a>, <a href="devices_techniccolorsensor.js.html#line55">line 55</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AbsoluteMotor.html">AbsoluteMotor</a></li><li><a href="BaseHub.html">BaseHub</a></li><li><a href="BasicMotor.html">BasicMotor</a></li><li><a href="ColorDistanceSensor.html">ColorDistanceSensor</a></li><li><a href="CurrentSensor.html">CurrentSensor</a></li><li><a href="Device.html">Device</a></li><li><a href="DuploTrainBase.html">DuploTrainBase</a></li><li><a href="DuploTrainBaseColorSensor.html">DuploTrainBaseColorSensor</a></li><li><a href="DuploTrainBaseMotor.html">DuploTrainBaseMotor</a></li><li><a href="DuploTrainBaseSpeaker.html">DuploTrainBaseSpeaker</a></li><li><a href="DuploTraniBaseSpeedometer.html">DuploTraniBaseSpeedometer</a></li><li><a href="Hub.html">Hub</a></li><li><a href="HubLED.html">HubLED</a></li><li><a href="LPF2Hub.html">LPF2Hub</a></li><li><a href="Light.html">Light</a></li><li><a href="Mario.html">Mario</a></li><li><a href="MarioAccelerometer.html">MarioAccelerometer</a></li><li><a href="MarioBarcodeSensor.html">MarioBarcodeSensor</a></li><li><a href="MarioPantsSensor.html">MarioPantsSensor</a></li><li><a href="MediumLinearMotor.html">MediumLinearMotor</a></li><li><a href="MotionSensor.html">MotionSensor</a></li><li><a href="MoveHub.html">MoveHub</a></li><li><a href="MoveHubMediumLinearMotor.html">MoveHubMediumLinearMotor</a></li><li><a href="MoveHubTiltSensor.html">MoveHubTiltSensor</a></li><li><a href="PiezoBuzzer.html">PiezoBuzzer</a></li><li><a href="PoweredUP.html">PoweredUP</a></li><li><a href="RemoteControl.html">RemoteControl</a></li><li><a href="RemoteControlButton.html">RemoteControlButton</a></li><li><a href="SimpleMediumLinearMotor.html">SimpleMediumLinearMotor</a></li><li><a href="TachoMotor.html">TachoMotor</a></li><li><a href="Technic3x3ColorLightMatrix.html">Technic3x3ColorLightMatrix</a></li><li><a href="TechnicColorSensor.html">TechnicColorSensor</a></li><li><a href="TechnicDistanceSensor.html">TechnicDistanceSensor</a></li><li><a href="TechnicForceSensor.html">TechnicForceSensor</a></li><li><a href="TechnicLargeAngularMotor.html">TechnicLargeAngularMotor</a></li><li><a href="TechnicLargeLinearMotor.html">TechnicLargeLinearMotor</a></li><li><a href="TechnicMediumAngularMotor.html">TechnicMediumAngularMotor</a></li><li><a href="TechnicMediumHub.html">TechnicMediumHub</a></li><li><a href="TechnicMediumHubAccelerometerSensor.html">TechnicMediumHubAccelerometerSensor</a></li><li><a href="TechnicMediumHubGyroSensor.html">TechnicMediumHubGyroSensor</a></li><li><a href="TechnicMediumHubTiltSensor.html">TechnicMediumHubTiltSensor</a></li><li><a href="TechnicSmallAngularMotor.html">TechnicSmallAngularMotor</a></li><li><a href="TechnicXLargeLinearMotor.html">TechnicXLargeLinearMotor</a></li><li><a href="TiltSensor.html">TiltSensor</a></li><li><a href="TrainMotor.html">TrainMotor</a></li><li><a href="VoltageSensor.html">VoltageSensor</a></li><li><a href="WeDo2SmartHub.html">WeDo2SmartHub</a></li></ul><h3>Events</h3><ul><li><a href="AbsoluteMotor.html#event:absolute">absolute</a></li><li><a href="AbsoluteMotor.html#event:rotate">rotate</a></li><li><a href="ColorDistanceSensor.html#event:ambient">ambient</a></li><li><a href="ColorDistanceSensor.html#event:color">color</a></li><li><a href="ColorDistanceSensor.html#event:colorAndDistance">colorAndDistance</a></li><li><a href="ColorDistanceSensor.html#event:distance">distance</a></li><li><a href="ColorDistanceSensor.html#event:distanceCount">distanceCount</a></li><li><a href="ColorDistanceSensor.html#event:reflect">reflect</a></li><li><a href="ColorDistanceSensor.html#event:rgbIntensity">rgbIntensity</a></li><li><a href="CurrentSensor.html#event:current">current</a></li><li><a href="DuploTrainBase.html#event:button">button</a></li><li><a href="DuploTrainBaseColorSensor.html#event:color">color</a></li><li><a href="DuploTrainBaseColorSensor.html#event:intensity">intensity</a></li><li><a href="DuploTrainBaseColorSensor.html#event:reflect">reflect</a></li><li><a href="DuploTrainBaseColorSensor.html#event:rgb">rgb</a></li><li><a href="DuploTrainBaseSpeedometer.html#event:speed">speed</a></li><li><a href="Hub.html#event:attach">attach</a></li><li><a href="Hub.html#event:button">button</a></li><li><a href="Hub.html#event:detach">detach</a></li><li><a href="Hub.html#event:disconnect">disconnect</a></li><li><a href="LPF2Hub.html#event:button">button</a></li><li><a href="Mario.html#event:button">button</a></li><li><a href="MarioAccelerometer.html#event:accel">accel</a></li><li><a href="MarioAccelerometer.html#event:gest">gest</a></li><li><a href="MarioBarcodeSensor.html#event:barcode">barcode</a></li><li><a href="MarioBarcodeSensor.html#event:rgb">rgb</a></li><li><a href="MarioPantsSensor.html#event:pants">pants</a></li><li><a href="MediumLinearMotor.html#event:rotate">rotate</a></li><li><a href="MotionSensor.html#event:distance">distance</a></li><li><a href="MoveHub.html#event:button">button</a></li><li><a href="MoveHubMediumLinearMotor.html#event:rotate">rotate</a></li><li><a href="MoveHubTiltSensor.html#event:tilt">tilt</a></li><li><a href="PoweredUP.html#event:discover">discover</a></li><li><a href="RemoteControl.html#event:button">button</a></li><li><a href="RemoteControlButton.html#event:button">button</a></li><li><a href="TachoMotor.html#event:rotate">rotate</a></li><li><a href="TechnicColorSensor.html#event:ambient">ambient</a></li><li><a href="TechnicColorSensor.html#event:color">color</a></li><li><a href="TechnicColorSensor.html#event:reflect">reflect</a></li><li><a href="TechnicDistanceSensor.html#event:distance">distance</a></li><li><a href="TechnicDistanceSensor.html#event:fastDistance">fastDistance</a></li><li><a href="TechnicForceSensor.html#event:force">force</a></li><li><a href="TechnicForceSensor.html#event:tapped">tapped</a></li><li><a href="TechnicForceSensor.html#event:touch">touch</a></li><li><a href="TechnicLargeAngularMotor.html#event:absolute">absolute</a></li><li><a href="TechnicLargeAngularMotor.html#event:rotate">rotate</a></li><li><a href="TechnicLargeLinearMotor.html#event:absolute">absolute</a></li><li><a href="TechnicLargeLinearMotor.html#event:rotate">rotate</a></li><li><a href="TechnicMediumAngularMotor.html#event:absolute">absolute</a></li><li><a href="TechnicMediumAngularMotor.html#event:rotate">rotate</a></li><li><a href="TechnicMediumHub.html#event:button">button</a></li><li><a href="TechnicMediumHubAccelerometerSensor.html#event:accel">accel</a></li><li><a href="TechnicMediumHubGyroSensor.html#event:gyro">gyro</a></li><li><a href="TechnicMediumHubTiltSensor.html#event:impactCount">impactCount</a></li><li><a href="TechnicMediumHubTiltSensor.html#event:tilt">tilt</a></li><li><a href="TechnicSmallAngularMotor.html#event:absolute">absolute</a></li><li><a href="TechnicSmallAngularMotor.html#event:rotate">rotate</a></li><li><a href="TechnicXLargeLinearMotor.html#event:absolute">absolute</a></li><li><a href="TechnicXLargeLinearMotor.html#event:rotate">rotate</a></li><li><a href="TiltSensor.html#event:tilt">tilt</a></li><li><a href="VoltageSensor.html#event:voltage">voltage</a></li><li><a href="WeDo2SmartHub.html#event:button">button</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Thu Apr 25 2024 16:38:07 GMT-0700 (Pacific Daylight Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>