mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Merge branch 'master' of https://github.com/node-red/node-red-nodes
This commit is contained in:
commit
6161df3380
9
hardware/PiLcd/locales/en-US/pilcd.html
Normal file
9
hardware/PiLcd/locales/en-US/pilcd.html
Normal file
@ -0,0 +1,9 @@
|
||||
<script type="text/x-red" data-help-name="rpi-lcd">
|
||||
<p>Raspberry Pi output to a HD44780 style LCD. Usually 1, 2, or 4 lines of characters.</p>
|
||||
<p>Expects a <code>msg.payload</code> with a string in it.</p>
|
||||
<p>Strings for the second line of the display must start <b>2:</b> - the third start <b>3:</b> - and the fourth <b>4:</b></p>
|
||||
<p>To clear the display send the string <b>clr:</b></p>
|
||||
<p>It is up to you to manage string lengths to suit the display.</p>
|
||||
<p>Requires the RPi.GPIO python library version 0.5.8 (or better) in order to work.</p>
|
||||
<p><b>Note:</b> we are using the actual physical pin numbers on connector P1 as they are easier to locate.</p>
|
||||
</script>
|
19
hardware/PiLcd/locales/en-US/pilcd.json
Normal file
19
hardware/PiLcd/locales/en-US/pilcd.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"pilcd": {
|
||||
"label": {
|
||||
"pins": "Pins"
|
||||
},
|
||||
"tip": {
|
||||
"tip": "<b>Tip</b>: Pins MUST be a comma separated list of the 6 GPIO connector pin numbers that are connected to the RS, E, D4, D5, D6 and D7 pins of the LCD."
|
||||
},
|
||||
"status": {
|
||||
"not-available": "not available",
|
||||
"na": "N/A : __value__"
|
||||
},
|
||||
"errors": {
|
||||
"ignorenode": "Raspberry Pi specific node set inactive",
|
||||
"libnotfound": "Cannot find Pi RPi.GPIO python library",
|
||||
"needtobeexecutable": "__command__ needs to be executable"
|
||||
}
|
||||
}
|
||||
}
|
9
hardware/PiLcd/locales/ja/pilcd.html
Normal file
9
hardware/PiLcd/locales/ja/pilcd.html
Normal file
@ -0,0 +1,9 @@
|
||||
<script type="text/x-red" data-help-name="rpi-lcd">
|
||||
<p>Raspberry PiがHD44780スタイルのLCDへ、通常1、2、4行の文字列を表示します。</p>
|
||||
<p>本ノードは、文字列型の<code>msg.payload</code>を受け付けます。</p>
|
||||
<p>ディスプレイの2行目に文字列を表示するには、<b>2:</b>から始まる文字列にします。3行目の場合は<b>3:</b>、4行目の場合は<b>4:</b>です。</p>
|
||||
<p>表示をクリアするには、文字列<b>clr:</b>を送信します。</p>
|
||||
<p>ディスプレイに合わせて文字列の長さを調整するのは、あなた自身で行ってください。</p>
|
||||
<p>このノードを動作させるには、RPi.GPIO Pythonライブラリバージョン0.5.8(またはそれ以上)が必要です。</p>
|
||||
<p><b>注釈:</b> 位置付けしやすい様に、コネクタP1の実際の物理ピン番号を使用しています。</p>
|
||||
</script>
|
19
hardware/PiLcd/locales/ja/pilcd.json
Normal file
19
hardware/PiLcd/locales/ja/pilcd.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"pilcd": {
|
||||
"label": {
|
||||
"pins": "ピン"
|
||||
},
|
||||
"tip": {
|
||||
"tip": "<b>注釈</b>: LCDのRS、E、D4、D5、D6、およびD7ピンに接続されている6つのGPIOコネクタのピン番号を、コンマで区切りでピンに入力する必要があります。"
|
||||
},
|
||||
"status": {
|
||||
"not-available": "利用不可",
|
||||
"na": "N/A : __value__"
|
||||
},
|
||||
"errors": {
|
||||
"ignorenode": "Raspberry Pi固有のノードを無視しました",
|
||||
"libnotfound": "RPi.GPIO pythonライブラリを見つけられませんでした",
|
||||
"needtobeexecutable": "__command__ は実行可能である必要があります"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,26 +1,14 @@
|
||||
|
||||
<script type="text/x-red" data-template-name="rpi-lcd">
|
||||
<div class="form-row">
|
||||
<label for="node-input-pins"><i class="fa fa-circle"></i> Pins</label>
|
||||
<label for="node-input-pins"><i class="fa fa-circle"></i> <span data-i18n="pilcd.label.pins"></label>
|
||||
<input type="text" id="node-input-pins" placeholder="RS,E,D4,D5,D6,D7">
|
||||
</div>
|
||||
<br/>
|
||||
<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">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></label>
|
||||
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||
</div>
|
||||
<div class="form-tips"><b>Tip</b>: Pins MUST be a comma separated list of the 6 GPIO
|
||||
connector pin numbers that are connected to the RS, E, D4, D5, D6 and D7 pins of the LCD.</div>
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="rpi-lcd">
|
||||
<p>Raspberry Pi output to a HD44780 style LCD. Usually 1, 2, or 4 lines of characters.</p>
|
||||
<p>Expects a <code>msg.payload</code> with a string in it.</p>
|
||||
<p>Strings for the second line of the display must start <b>2:</b> - the third start <b>3:</b> - and the fourth <b>4:</b></p>
|
||||
<p>To clear the display send the string <b>clr:</b></p>
|
||||
<p>It is up to you to manage string lengths to suit the display.</p>
|
||||
<p>Requires the RPi.GPIO python library version 0.5.8 (or better) in order to work.</p>
|
||||
<p><b>Note:</b> we are using the actual physical pin numbers on connector P1 as they are easier to locate.</p>
|
||||
<div class="form-tips" data-i18n="[html]pilcd.tip.tip"></div>
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
@ -11,20 +11,20 @@ module.exports = function(RED) {
|
||||
try {
|
||||
var cpuinfo = fs.readFileSync("/proc/cpuinfo").toString();
|
||||
if (cpuinfo.indexOf(": BCM") === -1) {
|
||||
RED.log.warn("rpi-lcd : "+RED._("node-red:rpi-gpio.errors.ignorenode"));
|
||||
RED.log.warn("rpi-lcd : "+RED._("pilcd.errors.ignorenode"));
|
||||
allOK = false;
|
||||
}
|
||||
else if (!fs.existsSync("/usr/share/doc/python-rpi.gpio")) {
|
||||
RED.log.warn("rpi-lcd : "+RED._("node-red:rpi-gpio.errors.libnotfound"));
|
||||
RED.log.warn("rpi-lcd : "+RED._("pilcd.errors.libnotfound"));
|
||||
allOK = false;
|
||||
}
|
||||
else if (!(1 & parseInt ((fs.statSync(gpioCommand).mode & parseInt ("777", 8)).toString (8)[0]))) {
|
||||
RED.log.warn("rpi-lcd : "+RED._("node-red:rpi-gpio.errors.needtobeexecutable",{command:gpioCommand}));
|
||||
RED.log.warn("rpi-lcd : "+RED._("pilcd.errors.needtobeexecutable",{command:gpioCommand}));
|
||||
allOK = false;
|
||||
}
|
||||
}
|
||||
catch(err) {
|
||||
RED.log.warn("rpi-lcd : "+RED._("node-red:rpi-gpio.errors.ignorenode"));
|
||||
RED.log.warn("rpi-lcd : "+RED._("pilcd.errors.ignorenode"));
|
||||
allOK = false;
|
||||
}
|
||||
|
||||
@ -89,9 +89,9 @@ module.exports = function(RED) {
|
||||
});
|
||||
}
|
||||
else {
|
||||
node.status({fill:"grey",shape:"dot",text:"node-red:rpi-gpio.status.not-available"});
|
||||
node.status({fill:"grey",shape:"dot",text:"pilcd.status.not-available"});
|
||||
node.on("input", function(msg){
|
||||
node.status({fill:"grey",shape:"dot",text:RED._("node-red:rpi-gpio.status.na",{value:msg.payload.toString()})});
|
||||
node.status({fill:"grey",shape:"dot",text:RED._("pilcd.status.na",{value:msg.payload.toString()})});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user