2013-10-25 08:01:25 +08:00
|
|
|
Cylon = require('..')
|
|
|
|
|
|
|
|
Cylon.robot
|
|
|
|
connection:
|
|
|
|
name: 'sphero', adaptor: 'sphero', port: '/dev/rfcomm0'
|
|
|
|
|
|
|
|
device:
|
|
|
|
name: 'sphero', driver: 'sphero'
|
|
|
|
|
|
|
|
work: (me) ->
|
|
|
|
every 1.second(), ->
|
2013-10-25 15:43:59 +08:00
|
|
|
me.sphero.setRGB Math.floor(Math.random() * 100000)
|
2013-10-25 08:01:25 +08:00
|
|
|
|
|
|
|
.start()
|