johnny-five
Version:
The JavaScript Arduino Programming Framework.
71 lines (56 loc) • 1.54 kB
JavaScript
// function tuner(step) {
// // Cannot control both at a time
// if (Group.side === -1) {
// return;
// }
// var set = Group.sets[Group.index];
// var part = set.parts[Group.side];
// var value = set.values[Group.side];
// console.log( part, "(part)" );
// console.log( legs[part] );
// if (value === null) {
// value = legs[part].startAt;
// }
// if (step < 0) {
// value--;
// } else {
// value++;
// }
// console.log( value, "(value)" );
// process.nextTick(function() {
// legs[part].to(value);
// });
// set.values[Group.side] = value;
// }
// function controller(ch, key) {
// if (key) {
// if (key.name === "space") {
// var next = Group.index - 1;
// if (next === -1) {
// next = Group.sets.length - 1;
// }
// Group.index = next;
// }
// if (key.name === "up") {
// tuner(1);
// }
// if (key.name === "down") {
// tuner(-1);
// }
// if (key.name === "left") {
// Group.side = 0;
// }
// if (key.name === "right") {
// Group.side = 1;
// }
// commands = [].slice.call(arguments);
// } else {
// if (ch >= 1 && ch <= 9) {
// speed = five.Fn.scale(ch, 1, 9, 0, 255);
// controller.apply(null, commands);
// }
// }
// }
// process.stdin.on("keypress", controller);
// process.stdin.setRawMode(true);
// process.stdin.resume();