UNPKG
sphero
Version:
latest (0.9.2)
0.9.2
0.9.1
0.9.0
0.8.3
0.8.2
0.8.1
0.8.0
0.7.0
0.6.0
0.5.0
0.4.1
0.4.0
0.3.0
0.2.0
0.1.1
0.1.0
Sphero.js
www.sphero.com
orbotix/sphero.js
sphero
/
examples
/
get-color.js
16 lines
(13 loc)
•
300 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"use strict"
;
var
sphero =
require
(
"../"
);
var
orb =
sphero
(process.
env
.
PORT
); orb.
connect
(
function
(
) {
// sets color to the provided r/g/b values
orb.
getColor
(
function
(
err, data
) {
if
(err) {
console
.
log
(err); }
else
{
console
.
log
(
"Color is:"
, data.
color
); } }); });