mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Remove checkbox for setting pwm frequency
This commit is contained in:
parent
26b9588ba6
commit
e8bcb4b6b5
@ -7,7 +7,6 @@
|
||||
"resistor": "Resistor?",
|
||||
"readinitial": "Read initial state of pin on deploy/restart?",
|
||||
"type": "Type",
|
||||
"setfreq": "Set frequency?",
|
||||
"freq": "Frequency",
|
||||
"initpin": "Initialise pin state?",
|
||||
"debounce": "Debounce",
|
||||
@ -34,8 +33,7 @@
|
||||
"pin": "<b>Pins in Use</b>: ",
|
||||
"in": "Only Digital Input is supported - input must be 0 or 1.",
|
||||
"dig": "Digital output - input must be 0 or 1.",
|
||||
"pwm": "PWM output - input must be between 0 to 100.",
|
||||
"freq": "Frequency must be in between 5 and 40000 Hz",
|
||||
"pwm": "PWM output - input must be between 0 to 100.<br/>Frequency must be in between 5 and 40000 Hz.",
|
||||
"ser": "Servo output - input must be between 0 to 100. 50 is centre.<br/>Min must be 500uS or more, Max must be 2500uS or less."
|
||||
},
|
||||
"types": {
|
||||
|
@ -381,11 +381,6 @@
|
||||
<option value="ser" data-i18n="pi-gpiod.servo"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-row" id="node-set-freq-tick">
|
||||
<label> </label>
|
||||
<input type="checkbox" id="node-input-setfreq" style="display:inline-block; width:auto; vertical-align:top;">
|
||||
<label for="node-input-setfreq" style="width:70%;"><span data-i18n="pi-gpiod.label.setfreq"></span></label>
|
||||
</div>
|
||||
<div class="form-row" id="node-set-frequency">
|
||||
<label> <span data-i18n="pi-gpiod.label.freq"></label>
|
||||
<input type="text" id="node-input-freq" style="width:70px;"> Hz
|
||||
@ -419,7 +414,6 @@
|
||||
</div>
|
||||
<div class="form-tips" id="dig-tip"><span data-i18n="[html]pi-gpiod.tip.dig"></span></div>
|
||||
<div class="form-tips" id="pwm-tip"><span data-i18n="[html]pi-gpiod.tip.pwm"></span></div>
|
||||
<div class="form-tips" id="freq-tip"><span data-i18n="[html]pi-gpiod.tip.freq"></span></div>
|
||||
<div class="form-tips" id="ser-tip"><span data-i18n="[html]pi-gpiod.tip.ser"></span></div>
|
||||
<div class="form-tips" id="pin-tip">Pins marked in blue are dual use. Make sure they are not enabled for
|
||||
their other use before using as GPIO.</div>
|
||||
@ -492,7 +486,7 @@
|
||||
$('#node-set-tick').hide();
|
||||
$('#node-set-state').hide();
|
||||
$('#node-input-set').prop('checked', false);
|
||||
$('#node-set-freq-tick').show();
|
||||
$("#node-set-frequency").show();
|
||||
$('#node-set-minimax').hide();
|
||||
$("#dig-tip").hide();
|
||||
$("#pwm-tip").show();
|
||||
@ -502,24 +496,18 @@
|
||||
$('#node-set-tick').hide();
|
||||
$('#node-set-state').hide();
|
||||
$('#node-input-set').prop('checked', false);
|
||||
$('#node-set-freq-tick').hide();
|
||||
$("#node-set-frequency").hide();
|
||||
$('#node-input-setfreq').prop('checked', false);
|
||||
$('#node-set-minimax').show();
|
||||
$("#dig-tip").hide();
|
||||
$("#pwm-tip").hide();
|
||||
$("#freq-tip").hide();
|
||||
$("#ser-tip").show();
|
||||
}
|
||||
else {
|
||||
$('#node-set-tick').show();
|
||||
$('#node-set-freq-tick').hide();
|
||||
$("#node-set-frequency").hide();
|
||||
$('#node-input-setfreq').prop('checked', false);
|
||||
$('#node-set-minimax').hide();
|
||||
$("#dig-tip").show();
|
||||
$("#pwm-tip").hide();
|
||||
$("#freq-tip").hide();
|
||||
$("#ser-tip").hide();
|
||||
}
|
||||
};
|
||||
@ -536,18 +524,6 @@
|
||||
$("#node-input-set").change(function () { setstate(); });
|
||||
setstate();
|
||||
|
||||
var setfreqstate = function () {
|
||||
if ($('#node-input-setfreq').is(":checked")) {
|
||||
$("#node-set-frequency").show();
|
||||
$("#freq-tip").show();
|
||||
} else {
|
||||
$("#node-set-frequency").hide();
|
||||
$("#freq-tip").hide();
|
||||
}
|
||||
};
|
||||
$("#node-input-setfreq").change(function () { setfreqstate(); });
|
||||
setfreqstate();
|
||||
|
||||
$('#pinform input').on('change', function() {
|
||||
this.pin = $("#pinform input[type='radio']:checked").val();
|
||||
$("#node-input-pin").val(this.pin);
|
||||
|
@ -149,7 +149,7 @@ module.exports = function(RED) {
|
||||
if (node.setfreq) {
|
||||
PiGPIO.set_PWM_frequency(node.pin,node.freq);
|
||||
}
|
||||
//PiGPIO.set_PWM_range(node.pin,1000);
|
||||
//PiGPIO.set_PWM_range(node.pin,1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user