mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Add out node
This commit is contained in:
@@ -36,6 +36,13 @@
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-template-name="rpi-sensehat out">
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
||||
<input type="text" id="node-input-name">
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="rpi-sensehat in">
|
||||
<p>Raspberry Pi Sense HAT input node.</p>
|
||||
<p>This node sends readings from the various sensors on the Sense HAT,
|
||||
@@ -75,10 +82,53 @@ is an object with the following values:</p>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="rpi-sensehat out">
|
||||
<p>Raspberry Pi Sense HAT output node.</p>
|
||||
<p>This node sends commands to the 8x8 LED display on the Sense HAT.</p>
|
||||
<p>Commands are sent to the node in <code>msg.payload</code>. Multiple commands can
|
||||
be sent in a single message by separating them with newline (\n) characters.<p>
|
||||
|
||||
<p><b>Set the colour of individual pixels</b></p>
|
||||
<p>Format: <code><x>,<y>,<colour></code>
|
||||
<p><code>x</code> and <code>y</code> must either be a value in the range 0-7, or
|
||||
<code>*</code> to indicate the entire row or column.</p>
|
||||
<p><code>colour</code> must be one of:
|
||||
<ul>
|
||||
<li>the well-known <a href="https://en.wikipedia.org/wiki/Web_colors" target="_new">HTML colour names</a>
|
||||
- eg <code>red</code> or <code>aquamarine</code>,</li>
|
||||
<li>the <a href="http://cheerlights.com/cheerlights-api/">CheerLights colour names</a>,</li>
|
||||
<li>a HEX colour value - eg <code>#aa9900</code></li>
|
||||
<li>an RGB triple - <code>190,255,0</code></li>
|
||||
<li>or simply <code>off</code></li>
|
||||
</ul>
|
||||
|
||||
<p><i>Examples</i></p>
|
||||
<p>To set the entire screen to red:</p>
|
||||
<p><code>*,*,red</code></p>
|
||||
<p>To set the four corners of the display to red, green (#00ff00), yellow and blue (0,0,255):</p>
|
||||
<p><code>0,0,red,0,7,#00ff00,7,7,yellow,7,0,0,0,255</code></p>
|
||||
|
||||
<p><b>Rotate the screen</b></p>
|
||||
<p>Format: <code>R<angle></code></p>
|
||||
<p><code>angle</code> must be 0, 90, 180 or 270.</p>
|
||||
|
||||
<p><b>Flip the screen</b></p>
|
||||
<p>Format: <code>R<axis></code></p>
|
||||
<p><code>axis</code> must be either <code>H</code> or <code>V</code> to flip on
|
||||
the horizontal or vertical axis respectively.</p>
|
||||
|
||||
<p><b>Scroll a message</b></p>
|
||||
<p>If <code>msg.payload</code> is not recognised as any of the above commands,
|
||||
it is treated as a text message to be scrolled across the screen.</p>
|
||||
<p>The following message properties can be used to customise the appearance:</p>
|
||||
<ul>
|
||||
<li><code>msg.colour</code> - the colour of the text, default: <code>white</code></li>
|
||||
<li><code>msg.background</code> - the colour of the background, default: <code>off</code></li>
|
||||
<li><code>msg.speed</code> - the scroll speed. A value in the range 1 (slower) to 5 (faster), default: <code>3</code></li>
|
||||
</ul>
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
RED.nodes.registerType('rpi-sensehat in',{
|
||||
category: 'Raspberry Pi',
|
||||
@@ -100,4 +150,23 @@ is an object with the following values:</p>
|
||||
return this.name?"node_label_italic":"";
|
||||
}
|
||||
});
|
||||
|
||||
RED.nodes.registerType('rpi-sensehat out',{
|
||||
category: 'Raspberry Pi',
|
||||
paletteLabel: "Sense HAT",
|
||||
color:"#c6dbef",
|
||||
defaults: {
|
||||
name: { value:"" },
|
||||
},
|
||||
inputs:1,
|
||||
outputs:0,
|
||||
icon: "rpi.png",
|
||||
align: "right",
|
||||
label: function() {
|
||||
return this.name||"Sense HAT";
|
||||
},
|
||||
labelStyle: function() {
|
||||
return this.name?"node_label_italic":"";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user