Device-WebIO-Dancer
view release on metacpan or search on metacpan
public/webiopi.js view on Meta::CPAN
WebIOPi.prototype.outputSequence = function (gpio, period, sequence, callback) {
$.post(w().context + 'GPIO/' + gpio + "/sequence/" + period + "," + sequence, function(data) {
w().updateValue(gpio, data);
if (callback != undefined) {
callback(gpio, data);
}
});
}
WebIOPi.prototype.callMacro = function (macro, args, callback) {
if (args == undefined) {
args = "";
}
$.post(w().context + 'macros/' + macro + "/" + args, function(data) {
if (callback != undefined) {
callback(macro, args, data);
}
});
}
public/webiopi.js view on Meta::CPAN
}
WebIOPi.prototype.createPulseButton = function (id, label, gpio) {
var button = webiopi().createButton(id, label);
button.bind(BUTTON_DOWN, function(event) {
webiopi().pulse(gpio);
});
return button;
}
WebIOPi.prototype.createMacroButton = function (id, label, macro, args) {
var button = webiopi().createButton(id, label);
button.bind(BUTTON_DOWN, function(event) {
webiopi().callMacro(macro, args);
});
return button;
}
WebIOPi.prototype.createSequenceButton = function (id, label, gpio, period, sequence) {
var button = webiopi().createButton(id, label);
button.bind(BUTTON_DOWN, function(event) {
webiopi().outputSequence(gpio, period, sequence);
});
return button;
( run in 0.569 second using v1.01-cache-2.11-cpan-49f99fa48dc )