forked from sphero-inc/sphero.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
22 lines (20 loc) · 823 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"use strict";
var Sphero = require("./lib/sphero");
/**
* Creates a new Sphero instance with the provided options.
*
* @param {String} address port/UUID/address of the connected Sphero
* @param {Object} [opts] options for sphero setup
* @param {Object} [opts.adaptor] if provided, a custom adaptor used for Sphero
* communication
* @param {Number} [opts.sop2=0xFD] SOP2 value to be passed to commands
* @param {Number} [opts.timeout=500] delay before a command is considered dead
* @example var orb = sphero("/dev/rfcomm0"); // linux
* @example var orb = sphero("COM4"); // windows
* @example
* var orb = sphero("/dev/tty.Sphero-OGB-AMP-SPP", { timeout: 300 }); // OS X
* @returns {Sphero} a new instance of Sphero
*/
module.exports = function sphero(address, opts) {
return new Sphero(address, opts);
};