Skip to content

Instantly share code, notes, and snippets.

@AdamMagaluk
Created June 2, 2014 20:16
Show Gist options
  • Save AdamMagaluk/0ed71dbb3bcdc70f2703 to your computer and use it in GitHub Desktop.
Save AdamMagaluk/0ed71dbb3bcdc70f2703 to your computer and use it in GitHub Desktop.
Zetta Scout Options
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);
});
};
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);
});
};
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