Created
June 2, 2014 20:16
-
-
Save AdamMagaluk/0ed71dbb3bcdc70f2703 to your computer and use it in GitHub Desktop.
Zetta Scout Options
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var util = require('util'); | |
var Scout = require('zetta').Scout; | |
var SerialPort = require('serialport').SerialPort; | |
var Sound = require('./sound'); | |
var ArduinoScout = module.exports = function(runtime) { | |
Scout.call(this); | |
this.runtime = runtime; | |
this.portName = '/dev/tty.usbserial'; | |
}; | |
util.inherits(ArduinoScout, Scout); | |
ArduinoScout.prototype.init = function(cb){ | |
var self = this; | |
this.runtime.implode(); | |
var port = new SerialPort(portName, function(err) { | |
if(err) { | |
return cb(err); | |
} | |
self.discover(Sound, port); | |
}); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SerialPort = require('serialport').SerialPort; | |
var Sound = require('./sound'); | |
var ArduinoScout = module.exports = function() { | |
this.portName = '/dev/tty.usbserial'; | |
}; | |
ArduinoScout.prototype.init = function(cb) { | |
var self = this; | |
var port = new SerialPort(portName, function(err){ | |
if(err){ | |
return cb(err); | |
} | |
self.emit('discover', Sound, port); | |
}); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SerialPort = require('serialport').SerialPort; | |
var Sound = require('./sound'); | |
module.exports = function(zetta) { | |
var portName = '/dev/tty.usbserial'; | |
zetta.init(function(cb) { | |
var port = new SerialPort(portName, function(err) { | |
zetta.discover(Sound, port); | |
}); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment