SRF node - add ability to set time interval

to close #338
This commit is contained in:
Dave Conway-Jones
2017-08-14 09:20:18 +01:00
parent 7950b7d39a
commit 363bb55b26
5 changed files with 19 additions and 10 deletions

View File

@@ -4,11 +4,14 @@
<label for="node-input-pins"><i class="fa fa-circle"></i> Pins</label>
<input type="text" id="node-input-pins" placeholder="Trigger,Echo">
</div>
<div class="form-row">
<label for="node-input-pulse"><i class="fa fa-clock-o"></i> Repeat (S)</label>
<input type="text" id="node-input-pulse" placeholder="time between readings">
</div>
<div class="form-row">
<label for="node-input-topic"><i class="fa fa-bars"></i> Topic</label>
<input type="text" id="node-input-topic" placeholder="optional topic">
</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">
@@ -20,7 +23,7 @@
<script type="text/x-red" data-help-name="rpi-srf">
<p>Raspberry Pi input from an SRF04 or SRF05 ultrasonic range finder.</p>
<p>Outputs a <code>msg.payload</code> with a number representing the range in cm.</p>
<p>Produces one measure every 0.5s - but only if the distance is different from the previous reading.</p>
<p>Produces one measurement every 0.5s (default) - but only if the distance is different from the previous reading.</p>
<p><b>Note:</b> we are using the actual physical pin numbers on connector P1 as they are easier to locate.</p>
</script>
@@ -31,6 +34,7 @@
defaults: {
name: { value:"" },
topic: { value:"SRF" },
pulse: {value:"0.5" },
pins: { value:"", required:true, validate:RED.validators.regex(/^\d+,\d+$/) }
},
inputs:0,