2014-07-25 11:07:23 +02:00
|
|
|
|
|
|
|
<script type="text/x-red" data-template-name="rpi-liter">
|
|
|
|
<div class="form-row">
|
2014-10-27 21:28:05 +01:00
|
|
|
<label for="node-input-pin"><i class="fa fa-cog"></i> Mode</label>
|
2015-01-06 15:54:45 +01:00
|
|
|
<select type="text" id="node-input-pin" style="width: 300px;">
|
2014-10-27 21:28:05 +01:00
|
|
|
<option value='' disabled selected style='display:none;'>select mode</option>
|
2014-07-25 11:07:23 +02:00
|
|
|
<option value="pi-liter">0-255 : one bit per led</option>
|
|
|
|
<option value="meter">0-8 : turns on led indicated - needle</option>
|
|
|
|
<option value="bar">0-8 : turns on leds up to value - bar</option>
|
|
|
|
<option value="pin">object : select led and set state</option>
|
|
|
|
<option value="all">0/1 : turn off/on ALL leds</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
2015-01-06 15:54:45 +01:00
|
|
|
<div class="form-row">
|
|
|
|
<label> </label>
|
|
|
|
<input type="checkbox" id="node-input-dir" style="display: inline-block; width: auto; vertical-align: top;">
|
|
|
|
<label for="node-input-dir" style="width: 70%;">Reverse bar direction ?</label>
|
|
|
|
</div>
|
2014-07-25 11:07:23 +02:00
|
|
|
<div class="form-row">
|
|
|
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
|
|
<input type="text" id="node-input-name" placeholder="Name">
|
|
|
|
</div>
|
|
|
|
<div class="form-tips">See the Info panel for descriptions of the different modes.</div>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/x-red" data-help-name="rpi-liter">
|
|
|
|
<p>Raspberry Pi-LITEr output node. The Pi-LITEr must be fitted.</p>
|
|
|
|
<p>Operates in one of 5 different modes :</p>
|
|
|
|
<ul>
|
2014-10-27 21:28:05 +01:00
|
|
|
<li><b>Byte Mode</b> - expects a value between 0 and 255, and each of the LEDs represent 1 bit.</li>
|
|
|
|
<li><b>Meter Mode</b> - expects a value between 0 and 8, the led lit corresponds to the input value - like a meter needle.</li>
|
|
|
|
<li><b>Bar Mode</b> - expects a value between 0 and 8, similar to meter - but all the leds up to the value are turned on - like a mini bar chart.</li>
|
|
|
|
<li><b>Object Mode</b> - expects a object specifying the LED and state eg. <code>{led:3,state:0}</code> to set LED3 off.</li>
|
|
|
|
<li><b>All LEDs Mode</b> - expects a 1 or 0 - turns on and off ALL the LEDs.</li>
|
2014-07-25 11:07:23 +02:00
|
|
|
</ul>
|
|
|
|
<p>Requires the WiringPi gpio command in order to work.</p>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
RED.nodes.registerType('rpi-liter',{
|
2014-10-27 21:28:05 +01:00
|
|
|
category: 'Raspberry Pi',
|
2015-01-06 15:54:45 +01:00
|
|
|
color:"#c6dbef",
|
2014-07-25 11:07:23 +02:00
|
|
|
defaults: {
|
2015-01-06 15:54:45 +01:00
|
|
|
name: {value:""},
|
|
|
|
pin: {value:"",required:true},
|
|
|
|
dir: {value:""}
|
2014-07-25 11:07:23 +02:00
|
|
|
},
|
|
|
|
inputs:1,
|
|
|
|
outputs:0,
|
2014-10-27 21:28:05 +01:00
|
|
|
icon: "light.png",
|
2014-07-25 11:07:23 +02:00
|
|
|
align: "right",
|
|
|
|
label: function() {
|
|
|
|
return this.name||"Pi-LITEr";
|
|
|
|
},
|
|
|
|
labelStyle: function() {
|
|
|
|
return this.name?"node_label_italic":"";
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|