node-red-contrib-grove-base-hat-dtam
Version:
The node for Grove Base HAT for Raspberry Pi with extensions for the DTAM project.
57 lines (52 loc) • 1.97 kB
HTML
<script type="text/javascript">
RED.nodes.registerType('grove-led',{
category: 'grove-base-hat',
color: '#a6bbcf',
defaults: {
name: {value:""},
port_number: {value:5},
device: { value: "grove-led" }
},
inputs:1,
outputs:0,
icon: "light.png",
label: function() {
return this.name||"grove-led";
}
});
</script>
<script type="text/x-red" data-template-name="grove-led">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Port</label>
<select style="width:90px;" id="node-input-port_number" value="5">
<option value="5">D5</option>
<option value="16">D16</option>
<option value="18">D18</option>
<option value="22">D22</option>
<option value="24">D24</option>
<option value="26">D26</option>
</select>
</div>
<div class="form-row">
<label for="node-input-device"><i class="icon-device"></i> Device</label>
<select style="width:160px;" id="node-input-device" value="grove-led">
<option value="grove-led">LED</option>
<option value="grove-variable-color-led">Variable color LED</option>
</select>
</div>
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>
<script type="text/x-red" data-help-name="grove-led">
<p>The node controls Grove LED.</p>
<h3>Inputs</h3>
<dl class="message-properties">
<dt>payload
<span class="property-type">number</span>
</dt>
<dd> the payload of the message to publish.</dd>
<h3>Details</h3>
<p>This node controls Grove LED. When the payload is 1, The node turn on it. When the payload is 0, The node turn off it.</p>
</script>