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?",
|
"resistor": "Resistor?",
|
||||||
"readinitial": "Read initial state of pin on deploy/restart?",
|
"readinitial": "Read initial state of pin on deploy/restart?",
|
||||||
"type": "Type",
|
"type": "Type",
|
||||||
"setfreq": "Set frequency?",
|
|
||||||
"freq": "Frequency",
|
"freq": "Frequency",
|
||||||
"initpin": "Initialise pin state?",
|
"initpin": "Initialise pin state?",
|
||||||
"debounce": "Debounce",
|
"debounce": "Debounce",
|
||||||
@ -34,8 +33,7 @@
|
|||||||
"pin": "<b>Pins in Use</b>: ",
|
"pin": "<b>Pins in Use</b>: ",
|
||||||
"in": "Only Digital Input is supported - input must be 0 or 1.",
|
"in": "Only Digital Input is supported - input must be 0 or 1.",
|
||||||
"dig": "Digital output - 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.",
|
"pwm": "PWM output - input must be between 0 to 100.<br/>Frequency must be in between 5 and 40000 Hz.",
|
||||||
"freq": "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."
|
"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": {
|
"types": {
|
||||||
|
@ -381,11 +381,6 @@
|
|||||||
<option value="ser" data-i18n="pi-gpiod.servo"></option>
|
<option value="ser" data-i18n="pi-gpiod.servo"></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</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">
|
<div class="form-row" id="node-set-frequency">
|
||||||
<label> <span data-i18n="pi-gpiod.label.freq"></label>
|
<label> <span data-i18n="pi-gpiod.label.freq"></label>
|
||||||
<input type="text" id="node-input-freq" style="width:70px;"> Hz
|
<input type="text" id="node-input-freq" style="width:70px;"> Hz
|
||||||
@ -419,7 +414,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-tips" id="dig-tip"><span data-i18n="[html]pi-gpiod.tip.dig"></span></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="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="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
|
<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>
|
their other use before using as GPIO.</div>
|
||||||
@ -492,7 +486,7 @@
|
|||||||
$('#node-set-tick').hide();
|
$('#node-set-tick').hide();
|
||||||
$('#node-set-state').hide();
|
$('#node-set-state').hide();
|
||||||
$('#node-input-set').prop('checked', false);
|
$('#node-input-set').prop('checked', false);
|
||||||
$('#node-set-freq-tick').show();
|
$("#node-set-frequency").show();
|
||||||
$('#node-set-minimax').hide();
|
$('#node-set-minimax').hide();
|
||||||
$("#dig-tip").hide();
|
$("#dig-tip").hide();
|
||||||
$("#pwm-tip").show();
|
$("#pwm-tip").show();
|
||||||
@ -502,24 +496,18 @@
|
|||||||
$('#node-set-tick').hide();
|
$('#node-set-tick').hide();
|
||||||
$('#node-set-state').hide();
|
$('#node-set-state').hide();
|
||||||
$('#node-input-set').prop('checked', false);
|
$('#node-input-set').prop('checked', false);
|
||||||
$('#node-set-freq-tick').hide();
|
|
||||||
$("#node-set-frequency").hide();
|
$("#node-set-frequency").hide();
|
||||||
$('#node-input-setfreq').prop('checked', false);
|
|
||||||
$('#node-set-minimax').show();
|
$('#node-set-minimax').show();
|
||||||
$("#dig-tip").hide();
|
$("#dig-tip").hide();
|
||||||
$("#pwm-tip").hide();
|
$("#pwm-tip").hide();
|
||||||
$("#freq-tip").hide();
|
|
||||||
$("#ser-tip").show();
|
$("#ser-tip").show();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('#node-set-tick').show();
|
$('#node-set-tick').show();
|
||||||
$('#node-set-freq-tick').hide();
|
|
||||||
$("#node-set-frequency").hide();
|
$("#node-set-frequency").hide();
|
||||||
$('#node-input-setfreq').prop('checked', false);
|
|
||||||
$('#node-set-minimax').hide();
|
$('#node-set-minimax').hide();
|
||||||
$("#dig-tip").show();
|
$("#dig-tip").show();
|
||||||
$("#pwm-tip").hide();
|
$("#pwm-tip").hide();
|
||||||
$("#freq-tip").hide();
|
|
||||||
$("#ser-tip").hide();
|
$("#ser-tip").hide();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -536,18 +524,6 @@
|
|||||||
$("#node-input-set").change(function () { setstate(); });
|
$("#node-input-set").change(function () { setstate(); });
|
||||||
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() {
|
$('#pinform input').on('change', function() {
|
||||||
this.pin = $("#pinform input[type='radio']:checked").val();
|
this.pin = $("#pinform input[type='radio']:checked").val();
|
||||||
$("#node-input-pin").val(this.pin);
|
$("#node-input-pin").val(this.pin);
|
||||||
|
@ -149,7 +149,7 @@ module.exports = function(RED) {
|
|||||||
if (node.setfreq) {
|
if (node.setfreq) {
|
||||||
PiGPIO.set_PWM_frequency(node.pin,node.freq);
|
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