set makeymakey node to use the module.exports style

This commit is contained in:
Dave C-J 2014-07-18 21:20:14 +01:00
parent 232a11983b
commit 76d05dc2cd

View File

@ -14,10 +14,11 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require(process.env.NODE_RED_HOME+"/red/red"); module.exports = function(RED) {
var hids = require('hidstream'); "use strict";
var hids = require('hidstream');
function MakeyNode(n) { function MakeyNode(n) {
RED.nodes.createNode(this,n); RED.nodes.createNode(this,n);
this.vid = 0x1b4f; // MakeyMakey vendor ID this.vid = 0x1b4f; // MakeyMakey vendor ID
this.pid = 0x2b75; // MakeyMakey product ID this.pid = 0x2b75; // MakeyMakey product ID
@ -80,5 +81,6 @@ function MakeyNode(n) {
if (tout) { clearTimeout(tout); } if (tout) { clearTimeout(tout); }
if (node.makey) { node.makey.device.close(); } if (node.makey) { node.makey.device.close(); }
}); });
}
RED.nodes.registerType("makeymakey",MakeyNode);
} }
RED.nodes.registerType("makeymakey",MakeyNode);