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 (51 loc) • 1.91 kB
HTML
<script type="text/javascript">
RED.nodes.registerType('grove-analog',{
category: 'grove-base-hat',
color: '#a6bbcf',
defaults: {
name: {value:""},
refresh_time: {value:1},
port_number: {value:0}
},
inputs:0,
outputs:1,
icon: "arrow-in.png",
label: function() {
return this.name||"grove-analog";
}
});
</script>
<script type="text/x-red" data-template-name="grove-analog">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Port</label>
<select style="width:90px; margin-left:20px;" id="node-input-port_number" value="0">
<option value="0">A0</option>
<option value="1">A1</option>
<option value="2">A2</option>
<option value="3">A3</option>
<option value="4">A4</option>
<option value="5">A5</option>
<option value="6">A6</option>
<option value="7">A7</option>
</select>
</div>
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i>Refresh time (s)</label>
<input type="number" id="node-input-refresh_time" placeholder="RefreshTime" value="1" min="0.1" max="10">
</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-analog">
<p>The node reads from the analog ports.</p>
<h3>Outputs</h3>
<dl class="message-properties">
<dt>payload
<span class="property-type">number</span>
</dt>
<dd>the payload of Grove analog status.</dd>
<h3>Details</h3>
<p>This node reads from the analog port and reports its value.</p>
</script>